Skip to main content

Notify

Trait Notify 

Source
pub trait Notify: Send + Sync {
    // Required method
    fn notify<'life0, 'life1, 'async_trait>(
        &'life0 self,
        notification: &'life1 Notification,
    ) -> Pin<Box<dyn Future<Output = Result<NotifyReceipt, NotifyError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

受管 SQL 通知只在宿主管理的异步 worker 内调用,不得在 SQL 生产路径调用。 业务也可直接调用进程通知接口,此时由业务负责超时、异常隔离与执行边界。 业务实现负责调用通知微服务;协议、鉴权和下游消息发送由业务拥有,框架不连接具体消息渠道。 Future 必须协作让出执行权且取消安全;同步阻塞或自行派生的后台任务不受宿主时间预算保护。

Required Methods§

Source

fn notify<'life0, 'life1, 'async_trait>( &'life0 self, notification: &'life1 Notification, ) -> Pin<Box<dyn Future<Output = Result<NotifyReceipt, NotifyError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

业务作用:投递一条已完成裁决和脱敏的通知,不参与业务事务。

参数说明:

  • notification:是只读有界消息。

返回:包含是否受理的回执或稳定失败;受理不表示最终用户收到,未知结果不得声明为安全重试。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§