コード例 #1
0
 TestObserver(IClientObservable observable)
 {
     this.observable = observable;
     observable.Subscribe(message =>
     {
         Notifications.Add(message);
         Received.Set();
     });
 }
コード例 #2
0
        public static void Initialize()
        {
            clients = GlobalHost.ConnectionManager.GetHubContext <Relay>().Clients;

            notifications = Task.Run(MvcApplication.System.CreateObservable).Result;
            notifications.Subscribe(On);

            Task.Run(Subscribe)
            .Wait();

            Task.Run(Resubscribe);
        }
コード例 #3
0
        public async Task Join()
        {
            notifications = await system.CreateObservable();

            notifications.Subscribe((ChatRoomMessage msg) =>
            {
                if (msg.User != user)
                {
                    Console.WriteLine(msg.Text);
                }
            });

            await room.Tell(new Join { User = user, Client = notifications.Ref });
        }
コード例 #4
0
        public static IDisposable Subscribe <T>(this IClientObservable observable, Action <T> callback)
        {
            Requires.NotNull(callback, nameof(callback));

            return(observable.Subscribe(new DelegateObserver(x => callback((T)x))));
        }
コード例 #5
0
 public void Refresh(IClientObservable co)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
ファイル: App.cs プロジェクト: stantoxt/Orleankka
 public App(IActorSystem system, IClientObservable observable)
 {
     this.system     = system;
     this.observable = observable;
 }