public IDatabusSynchronizationContext Publish(object message) { TaskUtil.Await(_dataBus.Publish(message)); var databusSynchronizationContext = new DatabusSynchronizationContext <object>(_publishResetEvent, _messageHandleResetEvent); _databusSynchronizationContext = databusSynchronizationContext; return(databusSynchronizationContext); }
public DatabusSynchronizationContext <TMessage> Publish <TMessage>(object message) where TMessage : class { TaskUtil.Await(_dataBus.Publish <TMessage>(message)); var databusSynchronizationContext = new DatabusSynchronizationContext <TMessage>(_publishResetEvent, _messageHandleResetEvent); _databusSynchronizationContext = databusSynchronizationContext; return(databusSynchronizationContext); }