public Push(Channel channel, string event_, JObject payload, int timeout) { //jfis - things seem too tied together. do pushes really need to know which channel they belong to? do channels need to know socket? _channel = channel; _event = event_; _payload = payload ?? Phoenix.EMPTY_JS_OBJECT; _receivedResp = null; _timeout = timeout; _timeoutTimer = new Timer() { AutoReset = false, Interval = _timeout }; _timeoutTimer.Elapsed += (o, e) => Trigger("timeout", Phoenix.EMPTY_JS_OBJECT); _recHooks = new List<ReceiveHook>(); //_sent = false; }
//remove(channel){ // this.channels = this.channels.filter( c => !c.isMember(channel.topic) ) //} internal void Remove(Channel channel) { _channels = _channels.Where(c => !c.IsMember(channel.Topic)).ToList(); }
//channel(topic, chanParams = {}){ // let chan = new Channel(topic, chanParams, this) // this.channels.push(chan) // return chan //} public Channel Channel(string topic, JObject chanParams) { var chan = new Channel(topic, chanParams, this); _channels.Add(chan); //jfis - js ppl have strange way of naming things. socket.Channel to makes and adds a channel. not obvious. return chan; }
internal void Remove(Channel channel) { // PhoenixJS: see the note above regarding stateChangeCallbacks // this.off(channel.stateChangeRefs) _channels.Remove(channel); }