コード例 #1
0
 public AzureSystemEventStore()
 {
     Streamer = new EventStreamer(new EventSerializer(MessagesProvider.GetKnownEventTypes()));
     CloudStorageAccount storageAccount = CloudStorageAccount.Parse(Settings.Default.AzureConnectionString);
     blobClient = storageAccount.CreateCloudBlobClient();
     container = blobClient.GetContainerReference(Settings.Default.AzureContainerName);
     container.CreateIfNotExist();
 }
コード例 #2
0
        public AzureSystemEventStore()
        {
            Streamer = new EventStreamer(new EventSerializer(MessagesProvider.GetKnownEventTypes()));
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(Config.Config.Get("Eventing.AzureConnectionString"));

            blobClient = storageAccount.CreateCloudBlobClient();
            container  = blobClient.GetContainerReference(Config.Config.Get("Eventing.AzureContainerName"));
            container.CreateIfNotExist();
        }
コード例 #3
0
        private readonly TimeSpan _historicalPollingInterval = TimeSpan.FromSeconds(20); // Todo: Config

        protected HistoricalDomainEventHandler(IEventStore eventStore,
                                               IEventStreamer eventStreamer,
                                               IEventHandlerStateStore eventHandlerStateStore)
        {
            _eventStore             = eventStore;
            _eventStreamer          = eventStreamer;
            _eventHandlerStateStore = eventHandlerStateStore;
            RegisterHandlers();
        }
コード例 #4
0
    public static async Task StreamAsync(this IEventStreamer eventStreamer, String topic, HttpContext httpContext, Func <Task <StatusCodeResult> > preflightFunction)
    {
        var preflightResponse = await preflightFunction();

        if (preflightResponse == null)
        {
            httpContext.Response.StatusCode = preflightResponse.StatusCode;

            return;
        }

        await eventStreamer.StreamAsync(topic, httpContext);
    }
コード例 #5
0
    public static async Task StreamAsync(this IEventStreamer eventStreamer, String topic, HttpContext httpContext)
    {
        var buffer    = new ArraySegment <Byte>(new Byte[4096]);
        var webSocket = await httpContext.WebSockets.AcceptWebSocketAsync();

        await eventStreamer.StreamAsync(topic, httpContext.RequestAborted, async message =>
        {
            await webSocket.SendTextAsync(message);

            var receiveResult = await webSocket.ReceiveAsync(buffer, httpContext.RequestAborted);

            if (receiveResult.CloseStatus.HasValue)
            {
                httpContext.Abort();
            }
        });
    }
コード例 #6
0
        public FileSystemEventStore(string basePath)
        {
            BasePath = basePath;

            Streamer = new EventStreamer(new EventSerializer(MessagesProvider.GetKnownEventTypes()));
        }