Skip to content

add explicit channel completion sinks (#4261)#4261

Open
mariusae wants to merge 1 commit into
meta-pytorch:mainfrom
mariusae:export-D108622920
Open

add explicit channel completion sinks (#4261)#4261
mariusae wants to merge 1 commit into
meta-pytorch:mainfrom
mariusae:export-D108622920

Conversation

@mariusae

@mariusae mariusae commented Jun 16, 2026

Copy link
Copy Markdown
Member

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 16, 2026
@meta-codesync

meta-codesync Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@mariusae has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108622920.

@mariusae mariusae force-pushed the export-D108622920 branch from 702d4c2 to b3fa436 Compare June 19, 2026 17:20
@meta-codesync meta-codesync Bot changed the title add explicit channel completion sinks (#4257) add explicit channel completion sinks (#4261) Jun 19, 2026
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
@mariusae mariusae force-pushed the export-D108622920 branch from b3fa436 to 82c5b41 Compare June 19, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant