You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More efficient backends may wish to batch messages transparently. This can be enabled by adding a flush async method to Transmitter with a default implementation of doing nothing. Invoking recv-requiring methods on Chan will implicitly call flush first (or concurrently?) to ensure communication dependency ordering is preserved. It's also necessary to call flush implicitly before split, since the concurrent receiving half might be waiting for a response to something already sent. A new method on Chan should be added which manually invokes flush, too. Finally, close should be made an async function, and it should call flush prior to dropping the channel, but only if there are no other references to the Arc awaiting the Tx—i.e., the transmitter should be automatically flushed on close only when the session is not going to be resumed by an outer context.
For non-batching backends, no code changes are necessary. Uses of close will need to be changed to be async.
The primary use case for this would be in the serde backend, which could now support a BufferedSender/BufferedReceiver pair, parametrized by all the parameters of the underlying transport for the non-buffering variety, as well as a maximum buffer size (which, if exceeded, triggers an automatic flush).
The text was updated successfully, but these errors were encountered:
More efficient backends may wish to batch messages transparently. This can be enabled by adding a
flush
async method toTransmitter
with a default implementation of doing nothing. Invokingrecv
-requiring methods onChan
will implicitly callflush
first (or concurrently?) to ensure communication dependency ordering is preserved. It's also necessary to callflush
implicitly beforesplit
, since the concurrent receiving half might be waiting for a response to something already sent. A new method onChan
should be added which manually invokesflush
, too. Finally,close
should be made an async function, and it should callflush
prior to dropping the channel, but only if there are no other references to theArc
awaiting theTx
—i.e., the transmitter should be automatically flushed on close only when the session is not going to be resumed by an outer context.For non-batching backends, no code changes are necessary. Uses of
close
will need to be changed to beasync
.The primary use case for this would be in the serde backend, which could now support a
BufferedSender
/BufferedReceiver
pair, parametrized by all the parameters of the underlying transport for the non-buffering variety, as well as a maximum buffer size (which, if exceeded, triggers an automatic flush).The text was updated successfully, but these errors were encountered: