示例#1
0
        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));
        }
示例#2
0
 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
     });
 }