Module reply

Module reply 

Source
Expand description

What a flavor writes back while it observes an event.

crate::build::ShardBuilder is the writing surface of the render, where a flavor states what is. This is the writing surface of an event, where it states what it says. That split is the whole rule, and it is what keeps crate::shard::ShardLogic at three methods rather than growing one per feature: a state belongs to the render, which restates it every turn until it stops being true; a word is said once, at a date, and no later render can restate it.

This accumulates rather than sends. The shard drains it once observe has returned, which keeps a flavor free of any borrow on the shard and lets a test drive observe with a scratch Reply and read back what came out.

Most of the verbs need nothing but the outbound queues the shard already owns. Reply::relay and Reply::announce need one thing more - the view, to turn an Audience into the connections that make it up - which is why they record what to deliver rather than to whom, and the shard expands them when it drains. Reply::switch is an orchestration between two shards that only a runtime can carry out, so it is recorded as an Effect and handed to whoever wired the shard up. A shard that belongs to no runtime says so out loud rather than pretending the move happened.

Structs§

Reply
What a flavor said during one crate::shard::ShardLogic::observe.
Spoken
One message a flavor asked to have delivered to an audience.

Enums§

Audience
Who a message is for, in the flavor’s own vocabulary.
Effect
Something a flavor asked for that its shard cannot carry out alone.
Word
One thing a flavor said to one connection.

Type Aliases§

Effects
Where a shard sends what it cannot do itself.