示例#1
0
        /// <summary>
        /// Starts the client.
        /// </summary>
        /// <param name="configuration">Configuration.</param>
        /// <returns>Started client.</returns>
        public static async Task <IIgniteClient> StartAsync(IgniteClientConfiguration configuration)
        {
            IgniteArgumentCheck.NotNull(configuration, nameof(configuration));

            var socket = await ClientFailoverSocket.ConnectAsync(configuration).ConfigureAwait(false);

            return(new IgniteClientInternal(socket));
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of <see cref="AtomicLongClient"/> class.
        /// </summary>
        /// <param name="socket">Socket.</param>
        /// <param name="name">Name.</param>
        /// <param name="groupName">Group name.</param>
        public AtomicLongClient(ClientFailoverSocket socket, string name, string groupName)
        {
            _socket    = socket;
            Name       = name;
            _groupName = groupName;

            var cacheName = AtomicsCacheName + "@" + (groupName ?? DefaultDataStructuresCacheGroupName);

            _cacheId = BinaryUtils.GetCacheId(cacheName);
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of <see cref="DataStreamerClient{TK,TV}"/>.
        /// </summary>
        /// <param name="socket">Socket.</param>
        /// <param name="cacheName">Cache name.</param>
        /// <param name="options">Options.</param>
        public DataStreamerClient(
            ClientFailoverSocket socket,
            string cacheName,
            DataStreamerClientOptions <TK, TV> options)
        {
            Debug.Assert(socket != null);
            Debug.Assert(!string.IsNullOrEmpty(cacheName));

            // Copy to prevent modification.
            _options   = new DataStreamerClientOptions <TK, TV>(options);
            _socket    = socket;
            _cacheName = cacheName;
            _cacheId   = BinaryUtils.GetCacheId(cacheName);
            _flags     = GetFlags(_options);

            var interval = _options.AutoFlushInterval;

            if (interval != TimeSpan.Zero)
            {
                _autoFlushTimer = new Timer(_ => AutoFlush(), null, interval, interval);
            }
        }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Compute"/> class.
 /// </summary>
 /// <param name="socket">Socket.</param>
 public Compute(ClientFailoverSocket socket)
 {
     _socket = socket;
 }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BinaryProcessorClient"/> class.
        /// </summary>
        /// <param name="socket">The socket.</param>
        public BinaryProcessorClient(ClientFailoverSocket socket)
        {
            Debug.Assert(socket != null);

            _socket = socket;
        }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Transactions"/> class.
 /// </summary>
 /// <param name="socket">Socket.</param>
 public Transactions(ClientFailoverSocket socket)
 {
     _socket = socket;
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Transaction"/> class.
 /// </summary>
 /// <param name="id">Transaction id.</param>
 /// <param name="socket">Associated connection.</param>
 /// <param name="failoverSocket">Associated connection multiplexer.</param>
 public Transaction(long id, ClientSocket socket, ClientFailoverSocket failoverSocket)
 {
     Id             = id;
     Socket         = socket;
     FailoverSocket = failoverSocket;
 }