add explicit channel completion sinks (#4261)#4261
Open
mariusae wants to merge 1 commit into
Open
Conversation
Contributor
|
@mariusae has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108622920. |
702d4c2 to
b3fa436
Compare
mariusae
added a commit
to mariusae/monarch
that referenced
this pull request
Jun 19, 2026
Summary: Replace the implicit oneshot-based channel return path with an explicit `SendCompletion` / `CompletionSink` contract. `Tx::do_post` now receives a concrete completion sink, `post()` uses `CompletionSink::ignore()`, and `try_post()` adapts the existing oneshot API through `CompletionSink::oneshot()`. Add explicit `accept()` and `reject()` calls at channel terminal points, and use `contramap_rejected()` for adapters such as `AttachTx` so accepted completions pass through unchanged while rejected wrapped messages are translated back to their outer message type. Convert `MailboxClient` to observe completions directly with `CompletionSink::callback()`, removing the per-message task that waited on a return-channel oneshot while preserving undeliverable handling and flush notification. ghstack-source-id: 393929682 exported-using-ghexport Reviewed By: andrewjcg Differential Revision: D108622920
mariusae
added a commit
to mariusae/monarch
that referenced
this pull request
Jun 19, 2026
Summary: Replace the implicit oneshot-based channel return path with an explicit `SendCompletion` / `CompletionSink` contract. `Tx::do_post` now receives a concrete completion sink, `post()` uses `CompletionSink::ignore()`, and `try_post()` adapts the existing oneshot API through `CompletionSink::oneshot()`. Add explicit `accept()` and `reject()` calls at channel terminal points, and use `contramap_rejected()` for adapters such as `AttachTx` so accepted completions pass through unchanged while rejected wrapped messages are translated back to their outer message type. Convert `MailboxClient` to observe completions directly with `CompletionSink::callback()`, removing the per-message task that waited on a return-channel oneshot while preserving undeliverable handling and flush notification. ghstack-source-id: 393929682 exported-using-ghexport Reviewed By: andrewjcg Differential Revision: D108622920
mariusae
added a commit
to mariusae/monarch
that referenced
this pull request
Jun 19, 2026
Summary: Replace the implicit oneshot-based channel return path with an explicit `SendCompletion` / `CompletionSink` contract. `Tx::do_post` now receives a concrete completion sink, `post()` uses `CompletionSink::ignore()`, and `try_post()` adapts the existing oneshot API through `CompletionSink::oneshot()`. Add explicit `accept()` and `reject()` calls at channel terminal points, and use `contramap_rejected()` for adapters such as `AttachTx` so accepted completions pass through unchanged while rejected wrapped messages are translated back to their outer message type. Convert `MailboxClient` to observe completions directly with `CompletionSink::callback()`, removing the per-message task that waited on a return-channel oneshot while preserving undeliverable handling and flush notification. ghstack-source-id: 393929682 exported-using-ghexport Reviewed By: andrewjcg Differential Revision: D108622920
Summary: Replace the implicit oneshot-based channel return path with an explicit `SendCompletion` / `CompletionSink` contract. `Tx::do_post` now receives a concrete completion sink, `post()` uses `CompletionSink::ignore()`, and `try_post()` adapts the existing oneshot API through `CompletionSink::oneshot()`. Add explicit `accept()` and `reject()` calls at channel terminal points, and use `contramap_rejected()` for adapters such as `AttachTx` so accepted completions pass through unchanged while rejected wrapped messages are translated back to their outer message type. Convert `MailboxClient` to observe completions directly with `CompletionSink::callback()`, removing the per-message task that waited on a return-channel oneshot while preserving undeliverable handling and flush notification. ghstack-source-id: 393929682 exported-using-ghexport Reviewed By: andrewjcg Differential Revision: D108622920
b3fa436 to
82c5b41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Replace the implicit oneshot-based channel return path with an explicit
SendCompletion/CompletionSinkcontract.Tx::do_postnow receives a concrete completion sink,post()usesCompletionSink::ignore(), andtry_post()adapts the existing oneshot API throughCompletionSink::oneshot(). Add explicitaccept()andreject()calls at channel terminal points, and usecontramap_rejected()for adapters such asAttachTxso accepted completions pass through unchanged while rejected wrapped messages are translated back to their outer message type. ConvertMailboxClientto observe completions directly withCompletionSink::callback(), removing the per-message task that waited on a return-channel oneshot while preserving undeliverable handling and flush notification.ghstack-source-id: 393929682
exported-using-ghexport
Reviewed By: andrewjcg
Differential Revision: D108622920