macro_rules! children {
($($keys:ident: $vals:expr,)*) => { ... };
(@sort,
$_:expr, $cbs:expr, $action:expr, $($sp:expr)?,
redundancy: $red:expr,
$($keys:ident: $vals:expr,)*) => { ... };
(@sort,
$red:expr, $_:expr, $action:expr, $($sp:expr)?,
callbacks: $cbs:expr,
$($keys:ident: $vals:expr,)*) => { ... };
(@sort,
$red:expr, $cbs:expr, $action:expr, $($_:expr)?,
supervisor: $sp:expr,
$($keys:ident: $vals:expr,)*) => { ... };
(@sort,
$red:expr, $cbs:expr, $_:expr, $($sp:expr)?,
action: $action:expr,
$($keys:ident: $vals:expr,)*) => { ... };
(@sort, $red:expr, $cbs:expr, $action:expr, ,) => { ... };
(@sort, $red:expr, $cbs:expr, $action:expr, $sp:expr,) => { ... };
}
This macro creates a new children group with the given amount of worker
callbacks, and a closure that will be executed when a message is received.
let children = children! {
redundancy: 100,
action: |msg| {
},
};
let sp = supervisor! {};
let children = children! {
supervisor: sp,
redundancy: 10,
action: |msg| {
},
};