Logo Mibo

AdaptiveSub Module

Functions for composing AdaptiveSub values.

Functions and values

Function or value Description

ofObservable id source handler

Full Usage: ofObservable id source handler

Parameters:
    id : SubId - Stable key the runtime uses to diff subscriptions across steps.
    source : IObservable<'T> - The observable to subscribe to.
    handler : SubPosting -> 'T -> unit - Receives the posting surface and each value.

Returns: AdaptiveSub
Modifiers: inline
Type parameters: 'T

Builds a subscription from an System.IObservable`1: the handler receives the SubPosting surface and each value, and queues work for the pre-step drain. The runner handles the work on the owner thread at the next step's boundary, before Update, so a callback thread never runs game code directly.

id : SubId

Stable key the runtime uses to diff subscriptions across steps.

source : IObservable<'T>

The observable to subscribe to.

handler : SubPosting -> 'T -> unit

Receives the posting surface and each value.

Returns: AdaptiveSub

ofTimer id interval tick

Full Usage: ofTimer id interval tick

Parameters:
    id : SubId - Stable key the runtime uses to diff subscriptions across steps.
    interval : TimeSpan - Tick interval.
    tick : SubPosting -> unit - Receives the posting surface once per tick.

Returns: AdaptiveSub
Modifiers: inline

Builds a subscription that ticks on a timer: the handler receives the SubPosting surface once per tick and queues work for the pre-step drain. The timer ticks on a thread-pool thread; only the queued work's drain runs on the owner thread.

id : SubId

Stable key the runtime uses to diff subscriptions across steps.

interval : TimeSpan

Tick interval.

tick : SubPosting -> unit

Receives the posting surface once per tick.

Returns: AdaptiveSub

prefix prefix sub

Full Usage: prefix prefix sub

Parameters:
Returns: AdaptiveSub
Modifiers: inline

Prefixes the subscription's SubId with a namespace, for parent-child composition — the adaptive counterpart of Sub.map without the message mapping. Delegates to SubId.prefix.

prefix : string
sub : AdaptiveSub
Returns: AdaptiveSub

Type something to start searching.