Exemplo n.º 1
0
 public EventRepository(
     IEventStreamWriter streamWriter,
     IEventStreamReader streamReader)
 {
     _streamWriter = streamWriter;
     _streamReader = streamReader;
 }
 public EventStreamSelfHealingWriter(IEventStreamWriter innerWriter, Func<Stream, IEventReader, IEventStreamVerifier> eventStreamVerifierFactory)
 {
     if (innerWriter == null) throw new ArgumentNullException("innerWriter");
     if (eventStreamVerifierFactory == null) throw new ArgumentNullException("eventStreamVerifierFactory");
     _innerWriter = innerWriter;
     _eventStreamVerifierFactory = eventStreamVerifierFactory;
 }
Exemplo n.º 3
0
        public EventStreamProducer(IEventStreamWriter streamWriter, IRetryPolicy retryPolicy)
        {
            Require.NotNull(streamWriter, "streamWriter");
            Require.NotNull(retryPolicy, "retryPolicy");

            m_streamWriter = streamWriter;
            m_retryPolicy = retryPolicy;
        }
Exemplo n.º 4
0
        public EventStreamProducer(IEventStreamWriter streamWriter, IRetryPolicy retryPolicy)
        {
            Require.NotNull(streamWriter, "streamWriter");
            Require.NotNull(retryPolicy, "retryPolicy");

            m_streamWriter = streamWriter;
            m_retryPolicy  = retryPolicy;
        }
        public EventStream(EventStreamAttribute attribute,
                           IWriteContext context              = null,
                           IEventStreamSettings settings      = null,
                           INotificationDispatcher dispatcher = null
                           )
        {
            _domainName     = attribute.DomainName;
            _entityTypeName = attribute.EntityTypeName;
            _instanceKey    = attribute.InstanceKey;


            if (null == settings)
            {
                _settings = new EventStreamSettings();
            }
            else
            {
                _settings = settings;
            }

            // wire up the event stream writer
            _writer = _settings.CreateWriterForEventStream(attribute);

            if (null != context)
            {
                _context = context;
                if (null != _writer)
                {
                    _writer.SetContext(_context);
                }
            }

            if (null == dispatcher)
            {
                if (!string.IsNullOrWhiteSpace(attribute.NotificationDispatcherName))
                {
                    _notificationDispatcher = NotificationDispatcherFactory.GetDispatcher(attribute.NotificationDispatcherName);
                }
                else
                {
                    // Create a new dispatcher
                    _notificationDispatcher = NotificationDispatcherFactory.GetDefaultDispatcher();
                }
            }
            else
            {
                _notificationDispatcher = dispatcher;
            }
        }
 public EventStreamSelfHealingWriter(IEventStreamWriter innerWriter)
     : this(innerWriter, EventStreamVerifier.Factory)
 {
 }