2 releases
new 0.5.4 | Dec 8, 2024 |
---|---|
0.5.3 | Dec 8, 2024 |
0.5.2 |
|
0.5.1 |
|
0.5.0 |
|
#613 in Asynchronous
489 downloads per month
175KB
4.5K
SLoC
Protocols. Actors interact by communication. Addresses, masks, subnets.
Addresses in mm1
are used as destinations to send messages to.
A type Address
is represented as a u64
integer, and is very similar
to IPv4- or IPv6-address, in that the whole space of addresses may be
split into sub-spaces using netmasks.
Example:
A subnet
aabbccddee000000/40
contains 2^24 addresses: fromaabbccddee000000
toaabbccddeeFFFFFF
.
The way addresses are written takes page from IPv6's notation: the
leftmost longest series of consequent zero hex-digits is replaced with a
':'
-sign. To improve readability, the address is surrounded by
corner brackets.
The reasons to choose corner brackets:
- so that they don't mix visually with IPv6-addresses.
- so that they do not require additional quotes when used in YAML.
- so that the addresses remind us a little bit of Erlang PIDs :).
Example:
aabbccddee000000/40
shall be written as<aabbccddee:>/40
.ffff000000084b03/64
shall be written as<ffff:84b03>/64
.
Actors' implementations should treat addresses as opaque types
(implementing Message
, Copy
, Eq
, Cmp
, and Hash
).
The nature of addresses should serve the convenience of the operators, and probably ease up the implementation of the multi-node messaging.
So, the default value for the node's subnet is <ffff:>/16
. This
probably should be treated as 127.0.0.0/8
in IPv4.
The API to implement actors.
An Envelope
is a type-erasing container for the sent messages.
Actor's behaviour is defined as an async-function that receives an
exclusive reference to some context as its first argument.
The concrete type of the context is supposed to remain unknown to
the actors: they are to interact with their contexts via a set of
traits, that are defined on a context.
Supervisors — the actors that manage other actors.
The building blocks shared across different types of supervisors.
Uniform supervisor — the actor, that supervises the children of the
same type.
Dependencies
~5–14MB
~165K SLoC