Macro ruva_core::init_event_handler
source · macro_rules! init_event_handler { ( $E:ty, $event_handler :expr, $( $(#[$asynchrony:ident])? $event:ty:[$($handler:ident $(=>($($injectable:ident $(( $($arg:ident),* ))? ),*))?),* $(,)? ] ),* $(,)? ) => { ... }; }
Expand description
This macro is used to create event handler for each event.
§Example
init_event_handler!(
YourServiceError,
|ctx| YourEventHandler(ApplicationRepository::new(ctx)),
#[async]
YourEvent:[handler1, handler2],
YourEvent2:[handler3, handler4],
);