Synchronous and recursive event system.
Introduction
An event system is a collection of objects that can receive and send signals.
In revent
we construct something called a [Node] containing an object of interest. This
object can invoke objects in other node
s, which in turn can invoke other objects - including
the originator - safely. This is done by suspending the &mut self
to the contents of a node.
Example
use Node;
let number = new;
number.emit;
See the documentation for [Channel] and [Slot] and [Suspend] for examples.
Intent
This library is intended to be used as a "suspendable RefCell
" by a bunch of objects which
wish to communicate with each other without using a central mediator object.
For instance, one can create a revent::Channel<dyn MyTrait>
which contains objects of
interest, where each object can inside its own handler do something along the lines of:
use ;
;
The above allows the object to emit a signal on a channel it is part of, even calling itself
recursively without mutably aliasing by suspending &mut self
.