Trait glommio::channels::sharding::Handler [−][src]
pub trait Handler<T>: Clone {
fn handle(
&self,
msg: T,
src_shard: usize,
cur_shard: usize
) -> HandlerResult;
}
Expand description
Trait for handling sharded messages
Required methods
fn handle(&self, msg: T, src_shard: usize, cur_shard: usize) -> HandlerResult
fn handle(&self, msg: T, src_shard: usize, cur_shard: usize) -> HandlerResult
Handle a message either received from an external stream of forwarded from another peer.
msg
- The message to handle.src_shard
- Id of the shard where the msg is from.cur_shard
- Id of the local shard.