• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IEventStoreConnection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IEventStoreConnection类属于命名空间,在下文中一共展示了IEventStoreConnection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: EventFactory

 public EventFactory(UserCredentials credentials, IEventStoreConnection connection)
 {
     _closedEvent = new ClosedEvent(credentials, connection);
     _openedEvent = new OpenedEvent(credentials, connection);
     _registerBreakerEvent = new RegisterBreakerEvent(credentials, connection);
     _tryingToCloseEvent = new TryingToCloseEvent(credentials, connection);
     _unregisterBreakerEvent = new UnregisterBreakerEvent(credentials, connection);
     _tolleratedOpenEvent = new TolleratedOpenEvent(credentials, connection);
 }
开发者ID:RokitSalad,项目名称:Helpful.CircuitBreaker.Events.EventStore,代码行数:9,代码来源:EventFactory.cs


示例10: Create

 public static Repository<User> Create(UnitOfWork unitOfWork, IEventStoreConnection connection, UserCredentials credentials)
 {
     return new Repository<User>(() => User.Factory(), unitOfWork, connection,
                                 new EventReaderConfiguration(
                                     new SliceSize(512),
                                     new JsonDeserializer(),
                                     new PassThroughStreamNameResolver(),
                                     new FixedStreamUserCredentialsResolver(credentials)));
 }
开发者ID:rmacdonaldsmith,项目名称:EventSourcedUserService,代码行数:9,代码来源:RepositoryFactory.cs


示例11: MeasurementReadCounterQuery

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

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


示例12: OuroStreamFactory

 public OuroStreamFactory(
     ILogger<IEventStore> logger,
     IEventStoreConnection eventStore,
     UserCredentials credentials)
 {
     _logger = logger;
     _eventStore = eventStore;
     _credentials = credentials;
 }
开发者ID:mhwk,项目名称:spray-chronicle,代码行数:9,代码来源:OuroStreamFactory.cs


示例13: 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


示例14: 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


示例15: SetUp

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


示例16: 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


示例17: 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


示例18: 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


示例19: 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


示例20: PostImporter

        public PostImporter()
        {
            _checkpoint = new FileCheckpoint("postsLoaded");

            _logger = new EventStore.ClientAPI.Common.Log.ConsoleLogger();

            var _connectionSettings =
                ConnectionSettings.Create()
                                  .UseConsoleLogger()
                                  .KeepReconnecting()
                                  .KeepRetrying()
                                  .OnConnected(_ => _logger.Info("Event Store Connected"))
                                  .OnDisconnected(_ => _logger.Error("Event Store Disconnected"))
                                  .OnReconnecting(_ => _logger.Info("Event Store Reconnecting"))
                                  .OnErrorOccurred((c, e) => _logger.Error(e, "Event Store Error :("));

            _connection = EventStoreConnection.Create(_connectionSettings, new IPEndPoint(IPAddress.Parse("192.81.222.61"), 1113));
            _connection.Connect();

            ThreadPool.SetMaxThreads(20, 20);
            ThreadPool.SetMinThreads(20, 20);
            //ServicePointManager.DefaultConnectionLimit = 1000;
            ServicePointManager.Expect100Continue = false;
            ServicePointManager.ServerCertificateValidationCallback = Validator;
            //ServicePointManager.EnableDnsRoundRobin = false;
            //ServicePointManager.DnsRefreshTimeout = Int32.MaxValue;
        }
开发者ID:rcknight,项目名称:AppDotNetEvents,代码行数:27,代码来源:Program.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IEventSymbol类代码示例发布时间:2022-05-24
下一篇:
C# IEventStore类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap