Beispiel #1
0
        static void Main(string[] args)
        {
            var handler = new PlayHandler();

            var conn = RethinkDB.R
                       .Connection()
                       .Hostname("localhost")
                       .Port(RethinkDBConstants.DefaultPort)
                       .Timeout(30)
                       .Connect();
            ReqlExpr dbTable = RethinkDB.R.Db("baseball").Table("plays");

            var feed = dbTable.Changes()
                       .RunChanges <Play>(conn, new { include_initial = true });

            var observe = feed.ToObservable();

            observe.SubscribeOn(CurrentThreadScheduler.Instance)
            .Subscribe((Change <Play> p) =>
            {
                handler.Handle(p.NewValue);
            });



            Console.WriteLine("Hit enter to exit...");
            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var mongo      = new MongoConnection();
            var rethink    = new RethinkConnection();
            var eventStore = new EventConnection();

            var system   = ActorSystem.Create("baseballStats");
            var topLevel = system.ActorOf(GameEventCoordinator.Create(), "gameCoordinator");

            var handler = new PlayHandler(topLevel);


            ReqlExpr dbTable = RethinkDB.R.Db("baseball").Table("plays");

            var feed = dbTable.Changes()
                       .RunChanges <Play>(RethinkConnection.Connection /*, new { include_initial = true }*/);

            var observe = feed.ToObservable();

            observe.SubscribeOn(CurrentThreadScheduler.Instance)
            .Subscribe((Change <Play> p) =>
            {
                handler.Handle(p.NewValue);
            });



            Console.WriteLine("Hit enter to exit...");
            Console.ReadLine();
        }