コード例 #1
0
        public IRestChannel Get(string name, ChannelOptions options)
        {
            if (!_channels.TryGetValue(name, out var result))
            {
                var channel = new RestChannel(_ablyRest, name, options);
                result = _channels.AddOrUpdate(name, channel, (s, realtimeChannel) =>
                {
                    if (options != null)
                    {
                        if (result != null)
                        {
                            result.Options = options;
                        }
                    }

                    return(realtimeChannel);
                });
            }
            else
            {
                if (options != null)
                {
                    result.Options = options;
                }
            }

            return(result);
        }
コード例 #2
0
ファイル: RestChannels.cs プロジェクト: withakay/ably-dotnet
        public bool Release(string name)
        {
            RestChannel removedChannel = null;

            if (_channels.TryRemove(name, out removedChannel))
            {
                return(true);
            }
            return(false);
        }