Crate kay [] [src]

Kay is a high-performance actor system, suitable for simulating millions of entities.

In Kay, actors concurrently send and receive asynchronous messages, but are otherwise completely isloated from each other. Actors can only mutate their own state.

Have a look at ActorSystem, ActorDefiner, World and Swarm to understand the main abstractions.

Current Shortcomings:

Modules

swarm

Tools for dealing with large amounts of identical actors

Structs

ActorDefiner

Helper that is used to define actor behaviour (message handlers).

ActorSystem

The main thing inside of which all the magic happens.

External

TODO: make this much more simple and just like a Box once we can move out of messages! An owning reference to local state outside the actor system that can safely be embedded in actor states and passed in messages, as long as they stay on one machine.

ID

An ID that uniquely identifies an Actor, or even a SubActor within a Swarm

Packet

Combination of a message and its destination recipient id

World

Gives limited access to an ActorSystem (typically from inside, in a message handler) to identify other actors and send messages to them.

Enums

Fate

Return type of message handling functions, signifying if an Actor/SubActor should live on after receiving a certain message type.

Traits

Message

Trait that a datastructure must implement in order to be sent and received as a message.