public void StarProduction()
        {
            var client = new JsonServiceClient("https://{0}.campfirenow.com".FormatWith(_account)) { UserName = _token, Password = "******" };
            var user = client.Get<CampfireUserWrapper>("/users/me.json").User;

            Parallel.ForEach(_roomsToJoin, (roomId) =>
            {
                client.Post<string>("/room/{0}/join.json".FormatWith(roomId), string.Empty);
                var roomListenerContext = new CampfireRoomListenerContext(roomId, _token, user.Id.ToInt(), OnMessageProduced);
                var roomListener = new CampfireRoomListener(roomListenerContext);
                _listeners.Add(roomListener);
                roomListener.StartListening();
            });
        }
Пример #2
0
        public void StarProduction()
        {
            var client = new JsonServiceClient("https://{0}.campfirenow.com".FormatWith(_account))
            {
                UserName = _token, Password = "******"
            };
            var user = client.Get <CampfireUserWrapper>("/users/me.json").User;

            Parallel.ForEach(_roomsToJoin, (roomId) =>
            {
                client.Post <string>("/room/{0}/join.json".FormatWith(roomId), string.Empty);
                var roomListenerContext = new CampfireRoomListenerContext(roomId, _token, user.Id.ToInt(), OnMessageProduced);
                var roomListener        = new CampfireRoomListener(roomListenerContext);
                _listeners.Add(roomListener);
                roomListener.StartListening();
            });
        }