Beispiel #1
0
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="config">队列数据 读取配置</param>
 /// <param name="onEnqueue"></param>
 /// <returns></returns>
 public void GetDequeueIdentity(Cache.MessageQueue.ReaderConfig config, Action <AutoCSer.Net.TcpServer.ReturnValue <ReturnParameter> > onEnqueue)
 {
     if (onEnqueue == null)
     {
         throw new ArgumentNullException();
     }
     ClientDataStructure.Client.MasterQueryAsynchronous(GetDequeueIdentityNode(config), onEnqueue);
 }
Beispiel #2
0
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="config">队列数据 读取配置</param>
 /// <param name="onEnqueue">直接在 Socket 接收数据的 IO 线程中处理以避免线程调度,适应于快速结束的非阻塞函数;需要知道的是这种模式下如果产生阻塞会造成 Socket 停止接收数据甚至死锁</param>
 /// <returns></returns>
 public void GetDequeueIdentityStream(Cache.MessageQueue.ReaderConfig config, Action <ReturnValue <ulong> > onEnqueue)
 {
     if (onEnqueue == null)
     {
         throw new ArgumentNullException();
     }
     ClientDataStructure.Client.MasterQueryAsynchronousStream(GetDequeueIdentityNode(config), onEnqueue);
 }
Beispiel #3
0
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="readerIndex">消费读取编号(0-65535)</param>
 /// <param name="config">队列数据 读取配置</param>
 /// <returns></returns>
 public ReturnValue <ulong> GetDequeueIdentity(int readerIndex, Cache.MessageQueue.ReaderConfig config)
 {
     if ((uint)readerIndex < Cache.MessageQueue.ReaderConfig.MaxReaderCount)
     {
         return(Client.GetULong(ClientDataStructure.Client.MasterQueryAsynchronous(getDequeueIdentityNode(readerIndex, config))));
     }
     return(new ReturnValue <ulong> {
         Type = ReturnType.MessageQueueReaderIndexOutOfRange
     });
 }
Beispiel #4
0
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="readerIndex">消费读取编号(0-65535)</param>
 /// <param name="config">队列数据 读取配置</param>
 /// <param name="onEnqueue"></param>
 /// <returns></returns>
 public void GetDequeueIdentity(int readerIndex, Cache.MessageQueue.ReaderConfig config, Action <AutoCSer.Net.TcpServer.ReturnValue <ReturnParameter> > onEnqueue)
 {
     if (onEnqueue == null)
     {
         throw new ArgumentNullException();
     }
     if ((uint)readerIndex < Cache.MessageQueue.ReaderConfig.MaxReaderCount)
     {
         ClientDataStructure.Client.MasterQueryAsynchronous(getDequeueIdentityNode(readerIndex, config), onEnqueue);
     }
     else
     {
         onEnqueue(new AutoCSer.Net.TcpServer.ReturnValue <ReturnParameter> {
             Value = new ReturnParameter(ReturnType.MessageQueueReaderIndexOutOfRange)
         });
     }
 }
Beispiel #5
0
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="readerIndex">消费读取编号(0-65535)</param>
 /// <param name="config">队列数据 读取配置</param>
 /// <param name="onEnqueue">直接在 Socket 接收数据的 IO 线程中处理以避免线程调度,适应于快速结束的非阻塞函数;需要知道的是这种模式下如果产生阻塞会造成 Socket 停止接收数据甚至死锁</param>
 /// <returns></returns>
 public void GetDequeueIdentityStream(int readerIndex, Cache.MessageQueue.ReaderConfig config, Action <ReturnValue <ulong> > onEnqueue)
 {
     if (onEnqueue == null)
     {
         throw new ArgumentNullException();
     }
     if ((uint)readerIndex < Cache.MessageQueue.ReaderConfig.MaxReaderCount)
     {
         ClientDataStructure.Client.MasterQueryAsynchronousStream(getDequeueIdentityNode(readerIndex, config), onEnqueue);
     }
     else
     {
         onEnqueue(new ReturnValue <ulong> {
             Type = ReturnType.MessageQueueReaderIndexOutOfRange
         });
     }
 }
Beispiel #6
0
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="config">队列数据 读取配置</param>
 /// <returns></returns>
 public ReturnValue <ulong> GetDequeueIdentity(Cache.MessageQueue.ReaderConfig config)
 {
     return(Client.GetULong(ClientDataStructure.Client.MasterQueryAsynchronous(GetDequeueIdentityNode(config))));
 }
Beispiel #7
0
 internal Parameter.Value GetDequeueIdentityNode(Cache.MessageQueue.ReaderConfig config)
 {
     Parameter.Value node = new Parameter.Value(this, OperationParameter.OperationType.MessageQueueGetDequeueIdentity);
     node.Parameter.SetJson(config);
     return(node);
 }
Beispiel #8
0
 private Parameter.Value getDequeueIdentityNode(int readerIndex, Cache.MessageQueue.ReaderConfig config)
 {
     Parameter.Value node = new Parameter.Value(new Parameter.Value(this, readerIndex), OperationParameter.OperationType.MessageQueueGetDequeueIdentity);
     node.Parameter.SetJson(config);
     return(node);
 }
Beispiel #9
0
 public void GetDequeueIdentityStream(IConvertible readerIndex, Cache.MessageQueue.ReaderConfig config, Action <AutoCSer.Net.TcpServer.ReturnValue <ReturnParameter> > onEnqueue)
 {
     GetDequeueIdentityStream(readerIndex.ToInt32(null), config, onEnqueue);
 }
Beispiel #10
0
 public void GetDequeueIdentityStream(IConvertible readerIndex, Cache.MessageQueue.ReaderConfig config, Action <ReturnValue <ulong> > onEnqueue)
 {
     GetDequeueIdentityStream(readerIndex.ToInt32(null), config, onEnqueue);
 }
Beispiel #11
0
 public ReturnValue <ulong> GetDequeueIdentity(IConvertible readerIndex, Cache.MessageQueue.ReaderConfig config)
 {
     return(GetDequeueIdentity(readerIndex.ToInt32(null), config));
 }
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="config">队列数据 读取配置</param>
 /// <returns></returns>
 public async Task <ReturnValue <ulong> > GetDequeueIdentityTask(Cache.MessageQueue.ReaderConfig config)
 {
     return(Client.GetULong(await ClientDataStructure.Client.MasterQueryAsynchronousAwaiter(GetDequeueIdentityNode(config))));
 }
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="readerIndex">消费读取编号(0-65535)</param>
 /// <param name="config">队列数据 读取配置</param>
 /// <returns></returns>
 public async Task <ReturnValue <ulong> > GetDequeueIdentityTask(IConvertible readerIndex, Cache.MessageQueue.ReaderConfig config)
 {
     if ((uint)readerIndex < Cache.MessageQueue.ReaderConfig.MaxReaderCount)
     {
         return(Client.GetULong(await ClientDataStructure.Client.MasterQueryAsynchronousAwaiter(getDequeueIdentityNode(readerIndex.ToInt32(null), config))));
     }
     return(new ReturnValue <ulong> {
         Type = ReturnType.MessageQueueReaderIndexOutOfRange
     });
 }