Struct libaggregator::reactor::Reactor
[−]
[src]
pub struct Reactor { /* fields omitted */ }
An auxiliary builder structure to plug all data sources at startup.
The builder is used to accumulate all the needed data sources. Then it is used to start up the reactor.
Methods
impl Reactor
[src]
fn new(logger: Logger) -> IoResult<Self>
Creates a new reactor.
The reactor starts as empty, with no data sources.
fn add_dsrc<F: DsrcFactory>(&mut self, factory: F)
Adds another data sources.
It calls the factory to create a new data source and installs it into the reactor.
fn add_compute<F: ComputeFactory>(&mut self, factory: F)
Adds another internal computation.
It calls the factory and installs the new data source into the reactor.
fn run(self, options: CmdlineOpts) -> IoResult<()>
Consumes the reactor builder and runs the main application loop.
This is the main entrypoint for the application and it'll drive all the asynchronous events in it. It handles:
- The timers for storage maintainence.
- Signal handlers (to terminate gracefuly).
- Eating data from the data sources.
- Listening and handling the downstream connections.
Params
options
: The command line options the application has been run with.