Пример #1
0
 /// <summary>
 /// 获取服务端可发送数量
 /// </summary>
 /// <param name="config">消息分发 读取配置</param>
 /// <param name="onEnqueue">直接在 Socket 接收数据的 IO 线程中处理以避免线程调度,适应于快速结束的非阻塞函数;需要知道的是这种模式下如果产生阻塞会造成 Socket 停止接收数据甚至死锁</param>
 /// <returns></returns>
 public void GetSendCountStream(Cache.MessageQueue.DistributionConfig config, Action <ReturnValue <uint> > onEnqueue)
 {
     if (onEnqueue == null)
     {
         throw new ArgumentNullException();
     }
     ClientDataStructure.Client.MasterQueryAsynchronousStream(GetSendCountNode(config), onEnqueue);
 }
Пример #2
0
 /// <summary>
 /// 获取服务端可发送数量
 /// </summary>
 /// <param name="config">消息分发 读取配置</param>
 /// <param name="onEnqueue"></param>
 /// <returns></returns>
 public void GetSendCount(Cache.MessageQueue.DistributionConfig config, Action <AutoCSer.Net.TcpServer.ReturnValue <ReturnParameter> > onEnqueue)
 {
     if (onEnqueue == null)
     {
         throw new ArgumentNullException();
     }
     ClientDataStructure.Client.MasterQueryAsynchronous(GetSendCountNode(config), onEnqueue);
 }
Пример #3
0
 /// <summary>
 /// 获取当前读取数据标识
 /// </summary>
 /// <param name="config">消息分发 读取配置</param>
 /// <returns></returns>
 public async Task <ReturnValue <uint> > GetSendCountTask(Cache.MessageQueue.DistributionConfig config)
 {
     return(Client.GetUInt(await ClientDataStructure.Client.MasterQueryAsynchronousAwaiter(GetSendCountNode(config))));
 }
Пример #4
0
 /// <summary>
 /// 获取服务端可发送数量
 /// </summary>
 /// <param name="config">消息分发 读取配置</param>
 /// <returns></returns>
 public ReturnValue <uint> GetSendCount(Cache.MessageQueue.DistributionConfig config)
 {
     return(Client.GetUInt(ClientDataStructure.Client.MasterQueryAsynchronous(GetSendCountNode(config))));
 }
Пример #5
0
 internal Parameter.Value GetSendCountNode(Cache.MessageQueue.DistributionConfig config)
 {
     Parameter.Value node = new Parameter.Value(this, OperationParameter.OperationType.MessageQueueGetDequeueIdentity);
     node.Parameter.SetJson(config);
     return(node);
 }