Struct heph::rt::Runtime[][src]

pub struct Runtime { /* fields omitted */ }
Expand description

The runtime that runs all actors.

The runtime will start workers threads that will run all actors, these threads will run until all actors have returned. See the module documentation for more information.

Implementations

Setup a new Runtime.

See Setup for the available configuration options.

Create a Runtime with the default configuration.

Notes

This is mainly useful for quick prototyping and testing. When moving to production you’ll likely want setup the runtime, at the very least to run a worker thread on all available CPU cores.

Attempt to spawn a new thread-safe actor.

See the Spawn trait for more information.

Spawn a new thread-safe actor.

See the Spawn trait for more information.

Spawn an synchronous actor that runs on its own thread.

For more information and examples of synchronous actors see the actor module.

Spawn a thread-safe Future.

See RuntimeRef::spawn_future for more documentation.

Run the function f on all worker threads.

This can be used to spawn thread-local actors, e.g. TcpServer, or to initialise thread-local data on each worker thread ensuring that it’s properly initialised without impacting the performance of the first request(s).

Receive process signals as messages.

This adds the actor_ref to the list of actor references that will receive a process signal.

Run the runtime.

This will wait until all spawned workers have finished, which happens when all actors have finished. In addition to waiting for all worker threads it will also watch for all process signals in Signal and relay them to actors that want to handle them, see the Signal type for more information.

Trait Implementations

Formats the value using the given formatter. Read more

Attempts to spawn an actor. Read more

Spawn an actor. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.