[][src]Crate constellation

Distributed programming primitives.

This library provides a runtime to aide in the writing and debugging of distributed programs.

The two key ideas are:

  • Spawning new processes: The spawn() function can be used to spawn a new process running a particular closure.
  • Channels: Senders and Receivers can be used for synchronous or asynchronous inter-process communication.

The only requirement to use is that init() must be called immediately inside your application's main() function.

Macros

Fn

Macro that wraps a closure, evaluating to a Fn struct that implements std::ops::Fn, Debug, Serialize and Deserialize, and various convenience traits.

FnMut

Macro that wraps a closure, evaluating to a FnMut struct that implements std::ops::FnMut, Debug, Serialize and Deserialize, and various convenience traits.

FnOnce

Macro that wraps a closure, evaluating to a FnOnce struct that implements std::ops::FnOnce, Debug, Serialize and Deserialize, and various convenience traits.

Structs

Pid

A process identifier.

Receiver

The receiving half of a channel.

Resources

Memory and CPU requirements for a process.

Sender

The sending half of a channel.

Enums

ChannelError

Channel operation error modes.

SpawnError

An error returned by the spawn() method detailing the reason if known.

TrySpawnError

An error returned by the try_spawn() method detailing the reason if known.

Constants

RESOURCES_DEFAULT

The Resources returned by Resources::default(). Intended to be used as a placeholder in your application until you have a better idea as to resource requirements.

Traits

FutureExt1

Extension trait to provide convenient block() method on futures.

Functions

init

Initialise the constellation runtime. This must be called immediately inside your application's main() function.

pid

Get the Pid of the current process.

resources

Get the memory and CPU requirements configured at initialisation of the current process.

spawn

Spawn a new process.

try_spawn

Spawn a new process if it can be allocated immediately.