Contextrecord
Subscription context used to register or associate readiness sources. A subscription may use an existing Source or create a scoped one.
Methods
source
source: function(Context, string, integer, function(): integer, (function(integer): integer)?): Source
Registers a source associated with this subscription.
Arguments
| Name | Type | Description |
|---|
? | Context | |
? | string | |
? | integer | |
? | function(): integer | |
? | (function(integer): integer)? | |
Returns
uses
Associates an existing source with this wait without changing its identity.
Arguments
Returns
canPark
canPark: function(Context): boolean
Reports whether the current handler can park this subscription.
Arguments
Returns
Fields
handler
Provider-owned active handler state.
associated
Sources associated with this subscription, when explicitly tracked.
Installedrecord
Handler restoration state owned by one installation. Its affine drop restores the outer context and releases registration state.
Methods
drop
drop: nosuspend function(takes self: Installed): nil
Canonical non-suspending affine cleanup for the installation.
Arguments
Returns
release
Restores the outer handler and releases this installation.
Arguments
Returns
Fields
co
Coroutine whose handler is installed, or the provider's main-state key.
previous
Captured outer handler state restored by release.
handler
Handler supplied by the caller.
transparent
Whether operations may delegate through to the outer context.
restored
Whether the outer handler has been restored.
released
Whether installation cleanup has completed.
parks
Provider bookkeeping for waits owned by this installation.
Sourcerecord
Readiness registration shared with callers and handlers. release must be idempotent and non-suspending; provider state tracks its lifetime.
Methods
release
Unregisters this source without suspending; repeated calls are harmless.
Arguments
Returns
releaseImpl
releaseImpl: function(Source): nil
Provider callback used by the canonical release method.
Arguments
Returns
Fields
name
Diagnostic identity of the readiness source.
priority
Readiness ordering key; smaller priorities are polled first.
wait
wait: (function(integer): integer)?
Optional bounded blocking waiter receiving milliseconds and returning progress.
active
active: (function(Source): boolean)?
Optional predicate deciding whether the source has outstanding work.
sequence
Stable registration-order tie breaker used by the provider.
poller
poller: (function(): integer)?
Provider-owned nonblocking readiness callback.
waiter
waiter: (function(integer): integer)?
Provider-owned blocking readiness callback.
released
Whether the registration has already been released.