]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
ds: support enqueued CODE refs with arguments
authorEric Wong <e@80x24.org>
Sat, 28 Jun 2025 11:20:10 +0000 (11:20 +0000)
committerEric Wong <e@80x24.org>
Mon, 30 Jun 2025 08:20:37 +0000 (08:20 +0000)
commit45235e9a336b7682e64a08b43a6e5fc326888f8d
tree26dfb35499b78ab581b321cd88bbced629bb978c
parent336a31838e814eb83a08d2b51b4809f0e11ba393
ds: support enqueued CODE refs with arguments

While we inherited support for enqueuing CODE refs from
Danga::Socket, it makes sense to support enqueuing CODE
refs with extra arguments specific to that CODE ref[1]
instead of relying on anonymous CODE refs to capture its
args..

Supporting args with CODE refs allows our ->flush_write
implementation to be more generic and no longer specific to
tmpio write buffering.  This change may eventually allow us
to chain multiple long_response calls together and eliminate
the {long_cb} field.

[1] we prefer CODE refs point to named subs with arguments
    passed to it to save RAM as opposed to constantly allocating
    new anonymous subs to capture local variables.
lib/PublicInbox/DS.pm
lib/PublicInbox/WwwStatic.pm