/// <summary> /// Create and initialize a segment with the specified index. /// </summary> internal Segment(long index, SourceConcurrentQueue <T> source) { _array = new T[SEGMENT_SIZE]; _state = new VolatileBool[SEGMENT_SIZE]; //all initialized to false _high = -1; Debug.Assert(index >= 0); _index = index; _source = source; }
public NewRedisClient3(IPEndPoint point) { _protocalStart = (byte)43; SocketConnectionFactory client = new SocketConnectionFactory(new SocketTransportOptions()); _connection = client.ConnectAsync(point).Result; _sender = _connection.Transport.Output; _reciver = _connection.Transport.Input; _receiverQueue = new SourceConcurrentQueue <TaskCompletionSource <bool> >(_sender); RunReciver(); }