当前位置: 首页>>代码示例>>C#>>正文


C# IEventStoreConnection类代码示例

本文整理汇总了C#中IEventStoreConnection的典型用法代码示例。如果您正苦于以下问题:C# IEventStoreConnection类的具体用法?C# IEventStoreConnection怎么用?C# IEventStoreConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IEventStoreConnection类属于命名空间,在下文中一共展示了IEventStoreConnection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EventStoreEventPersistence

 public EventStoreEventPersistence(
     ILog log,
     IEventStoreConnection connection)
 {
     _log = log;
     _connection = connection;
 }
开发者ID:joaomajesus,项目名称:EventFlow,代码行数:7,代码来源:EventStoreEventPersistence.cs

示例2: PopulateRefData

        //protected static readonly Serilog.ILogger Log = Log.ForContext<ReferenceDataHelper>();

        public static async Task PopulateRefData(IEventStoreConnection eventStoreConnection)
        {
            Log.Information("Reference Writer Service starting...");
            var repository = new Repository(eventStoreConnection, new EventTypeResolver(ReflectionHelper.ContractsAssembly));
            Log.Information("Initializing Event Store with Currency Pair Data");
            await new CurrencyPairInitializer(repository).CreateInitialCurrencyPairsAsync();
        }
开发者ID:AdaptiveConsulting,项目名称:ReactiveTraderCloud,代码行数:9,代码来源:ReferenceDataHelper.cs

示例3: EventStoreConnectionLogicHandler

        public EventStoreConnectionLogicHandler(IEventStoreConnection esConnection, ConnectionSettings settings)
        {
            Ensure.NotNull(esConnection, "esConnection");
            Ensure.NotNull(settings, "settings");

            _esConnection = esConnection;
            _settings = settings;

            _operations = new OperationsManager(_esConnection.ConnectionName, settings);
            _subscriptions = new SubscriptionsManager(_esConnection.ConnectionName, settings);

            _queue.RegisterHandler<StartConnectionMessage>(msg => StartConnection(msg.Task, msg.EndPointDiscoverer));
            _queue.RegisterHandler<CloseConnectionMessage>(msg => CloseConnection(msg.Reason, msg.Exception));

            _queue.RegisterHandler<StartOperationMessage>(msg => StartOperation(msg.Operation, msg.MaxRetries, msg.Timeout));
            _queue.RegisterHandler<StartSubscriptionMessage>(StartSubscription);

            _queue.RegisterHandler<EstablishTcpConnectionMessage>(msg => EstablishTcpConnection(msg.EndPoints));
            _queue.RegisterHandler<TcpConnectionEstablishedMessage>(msg => TcpConnectionEstablished(msg.Connection));
            _queue.RegisterHandler<TcpConnectionErrorMessage>(msg => TcpConnectionError(msg.Connection, msg.Exception));
            _queue.RegisterHandler<TcpConnectionClosedMessage>(msg => TcpConnectionClosed(msg.Connection));
            _queue.RegisterHandler<HandleTcpPackageMessage>(msg => HandleTcpPackage(msg.Connection, msg.Package));

            _queue.RegisterHandler<TimerTickMessage>(msg => TimerTick());

            _timer = new Timer(_ => EnqueueMessage(TimerTickMessage), null, Consts.TimerPeriod, Consts.TimerPeriod);
        }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:27,代码来源:EventStoreConnectionLogicHandler.cs

示例4: AsyncSnapshotReader

 /// <summary>
 /// Initializes a new instance of the <see cref="AsyncSnapshotReader"/> class.
 /// </summary>
 /// <param name="connection">The event store connection to use.</param>
 /// <param name="configuration">The configuration to use.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="connection"/> or <paramref name="configuration"/> are <c>null</c>.</exception>
 public AsyncSnapshotReader(IEventStoreConnection connection, SnapshotReaderConfiguration configuration)
 {
     if (connection == null) throw new ArgumentNullException("connection");
     if (configuration == null) throw new ArgumentNullException("configuration");
     _connection = connection;
     _configuration = configuration;
 }
开发者ID:EsbenSkovPedersen,项目名称:AggregateSource,代码行数:13,代码来源:AsyncSnapshotReader.cs

示例5: EventStoreCatchUpSubscription

        protected EventStoreCatchUpSubscription(IEventStoreConnection connection, 
                                                ILogger log,
                                                string streamId,
                                                bool resolveLinkTos,
                                                UserCredentials userCredentials,
                                                Action<EventStoreCatchUpSubscription, ResolvedEvent> eventAppeared, 
                                                Action<EventStoreCatchUpSubscription> liveProcessingStarted,
                                                Action<EventStoreCatchUpSubscription, SubscriptionDropReason, Exception> subscriptionDropped,
                                                bool verboseLogging,
                                                int readBatchSize = DefaultReadBatchSize,
                                                int maxPushQueueSize = DefaultMaxPushQueueSize)
        {
            Ensure.NotNull(connection, "connection");
            Ensure.NotNull(log, "log");
            Ensure.NotNull(eventAppeared, "eventAppeared");
            Ensure.Positive(readBatchSize, "readBatchSize");
            Ensure.Positive(maxPushQueueSize, "maxPushQueueSize");

            _connection = connection;
            Log = log;
            _streamId = string.IsNullOrEmpty(streamId) ? string.Empty : streamId;
            _resolveLinkTos = resolveLinkTos;
            _userCredentials = userCredentials;
            ReadBatchSize = readBatchSize;
            MaxPushQueueSize = maxPushQueueSize;

            EventAppeared = eventAppeared;
            _liveProcessingStarted = liveProcessingStarted;
            _subscriptionDropped = subscriptionDropped;
            Verbose = verboseLogging;
        }
开发者ID:jjvdangelo,项目名称:EventStore,代码行数:31,代码来源:EventStoreCatchUpSubscription.cs

示例6: GetStreamMetadata

 private static void GetStreamMetadata(IEventStoreConnection connection)
 {
     StreamMetadataResult metadata = connection.GetStreamMetadataAsync("test-stream").Result;
     Console.WriteLine("cache control: " + metadata.StreamMetadata.CacheControl);
     Console.WriteLine("custom value: " + metadata.StreamMetadata.GetValue<string>("key"));
     Console.WriteLine("max age: " + metadata.StreamMetadata.MaxAge);
     Console.WriteLine("max count: " + metadata.StreamMetadata.MaxCount);
 }
开发者ID:ppastecki,项目名称:EventStoreTutorial,代码行数:8,代码来源:Program.cs

示例7: AppendToStream

        private static void AppendToStream(IEventStoreConnection connection)
        {
            byte[] data = Encoding.UTF8.GetBytes("event data");
            byte[] metadata = Encoding.UTF8.GetBytes("event metadata");
            EventData eventData = new EventData(Guid.NewGuid(), "testEvent", false, data, metadata);

            connection.AppendToStreamAsync("test-stream", ExpectedVersion.Any, eventData).Wait();
        }
开发者ID:ppastecki,项目名称:EventStoreTutorial,代码行数:8,代码来源:Program.cs

示例8: DeviceSimulator

        public DeviceSimulator(IEventStoreConnection connection, IConsole console)
        {
            if (connection == null) throw new ArgumentNullException("connection");
            if (console == null) throw new ArgumentNullException("console");

            _connection = connection;
            _console = console;
        }
开发者ID:ajmal744,项目名称:EventStore-Examples,代码行数:8,代码来源:DeviceSimulator.cs

示例9: Main

        static void Main(string[] args)
        {
            Nodes.ForEach(n => n.Start());

            _connection = EventStoreConnection.Create(ConnectionSettings.Default,
                ClusterSettings.Create()
                    .DiscoverClusterViaGossipSeeds()
                    .SetGossipSeedEndPoints(new[]
                    {
                        new IPEndPoint(IPAddress.Loopback, 10004), new IPEndPoint(IPAddress.Loopback, 20004),
                        new IPEndPoint(IPAddress.Loopback, 30004)
                    }));

            _connection.ConnectAsync().Wait();

            Console.WriteLine("Waiting for nodes to start");
            Console.WriteLine("CBA to write code for this - Go sort out projections then press enter to begin");
            Console.ReadLine();

            Node master = GetMaster();

            while (!AreProjectionsFuckedYet())
            {
                master = GetMaster();
                master.FuckOff();
                Thread.Sleep(15000);
            }

            Console.WriteLine("Projections fucked!!! (Master is {0}, previously {1})", GetMaster().Name, master.Name);
            Console.ReadLine();
            Nodes.ForEach(n => n.FuckOff());
        }
开发者ID:pgermishuys,项目名称:ClusterFuck,代码行数:32,代码来源:Program.cs

示例10: Start

        public void Start()
        {
            if (EmbeddedEventStoreConfiguration.RunWithLogging)
            {
                if (!Directory.Exists(EmbeddedEventStoreConfiguration.LogPath))
                    Directory.CreateDirectory(EmbeddedEventStoreConfiguration.LogPath);
                LogManager.Init(string.Format("as-embed-es-{0}", DateTime.Now.Ticks), EmbeddedEventStoreConfiguration.LogPath);
            }

            var db = CreateTFChunkDb(EmbeddedEventStoreConfiguration.StoragePath);
            var settings = CreateSingleVNodeSettings();
            _node = new SingleVNode(db, settings, false, 0xf4240, new ISubsystem[0]);
            var waitHandle = new ManualResetEvent(false);
            _node.MainBus.Subscribe(new AdHocHandler<SystemMessage.BecomeMaster>(m => waitHandle.Set()));
            _node.Start();
            waitHandle.WaitOne();
            _credentials = new UserCredentials("admin", "changeit");
            _connection = EventStoreConnection.Create(
                ConnectionSettings.Create().
                                   EnableVerboseLogging().
                                   SetDefaultUserCredentials(_credentials).
                                   UseConsoleLogger(),
                TcpEndPoint);
            _connection.Connect();
        }
开发者ID:jen20,项目名称:AggregateSource,代码行数:25,代码来源:EmbeddedEventStore.cs

示例11: SetUp

 public void SetUp()
 {
     _connection = EmbeddedEventStore.Connection;
     _configuration = EventReaderConfigurationFactory.Create();
     _unitOfWork = new UnitOfWork();
     _factory = AggregateRootEntityStub.Factory;
 }
开发者ID:EsbenSkovPedersen,项目名称:AggregateSource,代码行数:7,代码来源:RepositoryTests.cs

示例12: Main

        static void Main(string[] args)
        {
            var system = ActorSystem.Create("playerComposition");

            var searcher = system.ActorOf(PlayerSearchSupervisor.Create(), "supervisor");

            //  akka://playerCOmposition/user/supervisor

            using (_conn = EventStoreConnection.Create(new IPEndPoint(IPAddress.Loopback, 1113)))
            {
                _conn.ConnectAsync().Wait();

                Console.WriteLine("Player ID: ");
                var playerId = Console.ReadLine();

                for (int balls = 0; balls < 4; balls++)
                {
                    for (int strikes = 0; strikes < 3; strikes++)
                    {
                        var count = $"{balls}{strikes}";
                        searcher.Tell(new FindPlayerAndCount(playerId, count));
                    }
                }

                Console.ReadLine();
            }
        }
开发者ID:DavidHoerster,项目名称:Agile.EventedBaseball,代码行数:27,代码来源:Program.cs

示例13: EventStoreProxy

        public EventStoreProxy(IComponentContext container)
        {
            _container = container;

            //Ensure we only set up the connection once
            lock (CreateConnectionLock)
            {
                if (_eventStoreConn == null)
                {
                    var connSettings = ConnectionSettings.Create()
                        .KeepReconnecting()
                        .KeepRetrying();

                    //TODO: get config value for address, port and user account
                    _eventStoreConn = EventStoreConnection.Create(connSettings, new IPEndPoint(IPAddress.Loopback, 1113));
                    _eventStoreConn.Disconnected += EventStoreConnDisconnected;
                    _eventStoreConn.ErrorOccurred += EventStoreConnErrorOccurred;
                    _eventStoreConn.Reconnecting += EventStoreConnReconnecting;
                    _eventStoreConn.Connected += EventStoreConnConnected;
                    _eventStoreConn.ConnectAsync().Wait();

                    SubscribeToStreamComment();
                    SubscribeToStreamTodo();
                }
            }
        }
开发者ID:nootn,项目名称:SampleFluxReactDotNet,代码行数:26,代码来源:EventStoreProxy.cs

示例14: EventStoreHolder

        EventStoreHolder(IHostConfiguration configuration, IBinarySerializer serializer)
        {
            var ipEndpoint = new IPEndPoint(configuration.EventStoreIp, configuration.EventStorePort);

            _connection = EventStoreConnection.Create(ipEndpoint);
            _serializer = serializer;
        }
开发者ID:PQ4NOEH,项目名称:.NET-recipes,代码行数:7,代码来源:EventStoreHolder.cs

示例15: Main

        static void Main(string[] args)
        {
            using (_conn = EventStoreConnection.Create(new IPEndPoint(IPAddress.Loopback, 1113)))
            {
                _conn.ConnectAsync().Wait();


                var config = ConfigurationFactory.ParseString(@"akka {  
                        actor {
                            provider = ""Akka.Remote.RemoteActorRefProvider, Akka.Remote""
                        }
                            remote {
                            helios.tcp {
                                port = 50000 #bound to a static port
                                hostname = localhost
                        }
                    }
                }");
                var system = ActorSystem.Create("atBatWriter", config); //akka.tcp://localhost:[email protected]/user

                var supervisor = system.ActorOf(AtBatSupervisor.Create(), "supervisor");

                Console.ReadLine();
            }
        }
开发者ID:DavidHoerster,项目名称:Agile.EventedBaseball,代码行数:25,代码来源:Program.cs


注:本文中的IEventStoreConnection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。