feat: add optional AbortSignal to every public async method - #673
Open
ZacLou wants to merge 2 commits into
Open
Conversation
Adds signal?: AbortSignal to all public async methods on StreamsModule and FactoryModule, with an abort check at the start of each method and in the _sendAndPoll polling loop. This gives callers a consistent way to cancel any in-flight operation. StreamsModule (13 methods): get, withdrawable, streamedTotal, withdraw, cancel, pause, resume, topUp, forceCancel, transferRecipient, clawback, estimateFee, list FactoryModule (5 methods): streamCount, streamAddress, streamsBySender, streamsByRecipient, protocolFeeBps Internal helpers _resolveAddr, _simulateTx, _invoke, and _sendAndPoll also accept signal for deeper cancellation support. Addresses conduit-protocol#604
ZacLou
force-pushed
the
feat/abort-signal-all-methods-604
branch
from
September 5, 2026 14:46
4d69237 to
da24857
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
Addresses #604
Problem
Some methods threaded
{ signal }, others didn't. There was no consistent way for callers to cancel an in-flight operation.Changes
StreamsModule (13 methods)
Added
signal?: AbortSignalto:get,withdrawable,streamedTotal,withdraw,cancel,pause,resume,topUp,forceCancel,transferRecipient,clawback,estimateFee,listFactoryModule (5 methods)
Added
signal?: AbortSignalto:streamCount,streamAddress,streamsBySender,streamsByRecipient,protocolFeeBpsInternal helpers
_resolveAddr,_simulateTx,_invoke, and_sendAndPollnow acceptsignal_sendAndPollpolling loop so confirmation waits can be cancelledUsage
Backward compatibility
signalis optional and defaults toundefined. All existing code continues to work unchanged.Verification