-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
add MessageContext, so the message handler can use the app data, like connecting to database, can send MQ message.etc.
struct HelloWorldMessage;
#[async_trait]
impl Message for HelloWorldMessage {
type Output = String;
async fn handle(self, messager: Arc<Messager>, context: MessageContext) -> Self::Output {
let conn = context.get::<DatabasePool>();
// do something
}
}