AsyncSynapses<P extends Pulse, L extends Cell> class
An Asynchronous Projection of a Synapses instance for non‑blocking signal distribution.
AsyncSynapses functions as a Concurrent Dispatcher within the reactive network. It allows Pulse stimuli to be broadcast across asynchronous boundaries, ensuring that high‑latency downstream transformations do not block the primary execution thread.
When to use
- You obtain an instance via
synapses.async:final asyncSynapses = cell._nucleus.synapses.async; - When you are in an asynchronous context and need to broadcast without blocking.
- When you want to wait for the entire propagation to complete
(
serializedCompletion: true). - For fire‑and‑forget scenarios where you don't care about completion.
How it works
- The async synapses wraps the synchronous synapses.
- The
callmethod queues the pulse into a thread‑safe buffer. - A background worker processes the queue sequentially.
- The worker respects the propagation policy (debounce, throttle, etc.) and the filter.
- The
serializedCompletionflag controls whether to wait for all downstream propagation to finish.
Example: Awaiting Completion
final async = synapses.async;
await async.call(Pulse('update'), serializedCompletion: true);
print('Propagation complete');
See also:
- Synapses.async – the getter that provides this.
- ReceptorAsync – similar pattern for receptors.
- Inheritance
-
- Object
- IterableBase<
L> - SynapsesBase<
P, L> - AsyncSynapses
Properties
-
async
→ AsyncSynapses<
P, L> -
Returns an asynchronous projection of these synapses for non‑blocking
signal distribution.
latefinalinherited
- first → L
-
The first element.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
L> -
A new
Iteratorthat allows iterating the elements of thisIterable.no setterinherited - last → L
-
The last element.
no setterinherited
- length → int
-
The number of elements in this Iterable.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → L
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
Methods
-
any(
bool test(L element)) → bool -
Checks whether any element of this iterable satisfies
test.inherited -
call(
covariant P pulse) → Future< void> -
The primary execution entry point for the Signal Distribution Network,
responsible for ingesting, filtering, and propagating pulses to all
registered downstream observers.
override
-
cast<
R> () → Iterable< R> -
A view of this iterable as an iterable of
Rinstances.inherited -
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element.inherited -
elementAt(
int index) → L -
Returns the
indexth element.inherited -
every(
bool test(L element)) → bool -
Checks whether every element of this iterable satisfies
test.inherited -
expand<
T> (Iterable< T> toElements(L element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(
bool test(L element), {L orElse()?}) → L -
The first element that satisfies the given predicate
test.inherited -
fold<
T> (T initialValue, T combine(T previousValue, L element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< L> other) → Iterable<L> -
Creates the lazy concatenation of this iterable and
other.inherited -
forEach(
void action(L element)) → void -
Invokes
actionon each element of this iterable in iteration order.inherited -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(L element), {L orElse()?}) → L -
The last element that satisfies the given predicate
test.inherited -
link(
Cell cell, {required Cell downstreamCell}) → FutureOr< bool> -
Establishes a formal reactive connection (link) between the host
celland adownstreamCell.inherited -
map<
T> (T toElement(L e)) → Iterable< T> -
The current elements of this iterable modified by
toElement.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reduce(
L combine(L value, L element)) → L -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
singleWhere(
bool test(L element), {L orElse()?}) → L -
The single element that satisfies
test.inherited -
skip(
int count) → Iterable< L> -
Creates an Iterable that provides all but the first
countelements.inherited -
skipWhile(
bool test(L element)) → Iterable< L> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.inherited -
take(
int count) → Iterable< L> -
Creates a lazy iterable of the
countfirst elements of this iterable.inherited -
takeWhile(
bool test(L element)) → Iterable< L> -
Creates a lazy iterable of the leading elements satisfying
test.inherited -
toList(
{bool growable = true}) → List< L> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< L> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
Returns a string representation of (some of) the elements of
this.inherited -
unlink(
Cell cell, {required Cell downstreamCell}) → bool -
Formally dissolves the reactive connection (link) between the host
celland thedownstreamCell, neutralising the signal path between them.inherited -
where(
bool test(L element)) → Iterable< L> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test.inherited -
whereType<
T> () → Iterable< R> -
Creates a new lazy Iterable with all elements that have type
T.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited