public NybusBus(IBusEngine engine, INybusOptions options) { if (engine == null) { throw new ArgumentNullException(nameof(engine)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } _engine = engine; _options = options; _logger = _options.LoggerFactory.CreateLogger(nameof(NybusBus)); }
public EventContext <TEvent> CreateContext <TEvent>(EventMessage <TEvent> message, INybusOptions options) where TEvent : class, IEvent { return(new EventContext <TEvent>(message.Event, _clock.Now, message.CorrelationId) { RaisedOn = message.SentOn }); }
public CommandContext <TCommand> CreateContext <TCommand>(CommandMessage <TCommand> message, INybusOptions options) where TCommand : class, ICommand { return(new CommandContext <TCommand>(message.Command, _clock.Now, message.CorrelationId) { InvokedOn = message.SentOn }); }