示例#1
0
        public void write_to_sync()
        {
            var endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1113);

            using (var connection = new EventStoreConnection(endpoint))
            {
                var ev = new TestEvent("Some data");
                connection.AppendToStream("test", -2, new[] { ev });
            }
        }
        public override void SetUp()
        {
            base.SetUp();
            _node = new MiniNode(PathName);
            _node.Start();

            _firstEvent = TestEvent.NewTestEvent();

            _connection = EventStoreConnection.Create();
            _connection.Connect(_node.TcpEndPoint);

            _connection.AppendToStream("test-stream",
                                       ExpectedVersion.NoStream,
                                       _firstEvent,
                                       TestEvent.NewTestEvent(),
                                       TestEvent.NewTestEvent());

            using (var transaction = _connection.StartTransaction("test-stream", 3))
            {
                transaction.Commit();
            }
        }
示例#3
0
 public static void AppendToStream(string stream, int expectedVersion, IEnumerable <IEvent> events)
 {
     _connection.AppendToStream(stream, expectedVersion, events);
 }
示例#4
0
 public void write_to_loop()
 {
     var endpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1113);
     using (var connection = new EventStoreConnection(endpoint))
     {
         for (var i = 0; i < 1000; ++i)
         {
             var ev = new TestEvent("Some data");
             connection.AppendToStream("test", -2, new[] { ev });
         }
     }
 }