Examples
The odin_actor/examples
directory contains a set of runnable example applications that each introduce and demonstrate a single
odin_actor
feature. It is recommended to go through examples in the following sequence:
hello_world
: the basics (actorsystem, actor and sending messages)sys_msgs
: using system messages and timersspawn
: spawning one-shot async tasks from within actorsspawn_blocking
: spawn blocking tasks (running in threads) from within actorsexec
: using the genericexec(..)
to execute closures within actor tasksjobs
: scheduling generic jobs with the actor system globalJobScheduler
producer_consumer
: point-to-point actor communication withMsgReceiver
pub_sub
: publish/subscribe communication using a staticMsgReceiverList<T>
dyn_pub_sub
: dynamic publish/subscribe communication usingDynMsgReceiver<T>
andDynMsgReceiverList<T>
ping_pong
: managing cyclic actor dependencies withPreActorHandle
query
: usingQuery<Q,A>
to send a message and wait for an answerdyn_actor
: dynamically create actors from within actorsactions
: statically configure actor interaction withDataAction
dyn_actions
: dynamically configure actor interaction withDynDataAction
retry
: handling back-pressure withretry_send_msg(..)
requests
: sequential processing of requests in background taskactor_config
: configuring actors with theconfig_for!(..)
macroheartbeat
: monitoring actor systems with heartbeat messages