TestObserver(IClientObservable observable) { this.observable = observable; observable.Subscribe(message => { Notifications.Add(message); Received.Set(); }); }
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); }
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 }); }
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)))); }
public void Refresh(IClientObservable co) { throw new NotImplementedException(); }
public App(IActorSystem system, IClientObservable observable) { this.system = system; this.observable = observable; }