public void Initial()
 {
     _startQueueScedule.SetSceduleWork(1, (o, e) => StartQueues());
     _removedTimeoutConsumersScedule.SetSceduleWork(ConsumerTimeoutSeconds * 100, (o, e) =>
                                                    this.Session.ClientBehavior.ConsumerTimeout(ConsumerTimeoutSeconds)
                                                    );
 }
Esempio n. 2
0
 private void SetSceduleWork()
 {
     _consumerTimer.SetSceduleWork(_consumeSceduleInterval, (o, b) =>
     {
         Util.Helper.ThreadHelper.TryLock(lockobj, () =>
         {
             var request  = this.CreateRequestByRequestType(ConsumerRequestType.consume);
             var response = this.SendRequest(request);
             if (response != null && response.CanConsume)
             {
                 this._consumeTask.Invoke(response);
                 this.SendConsumerCallbackRequest(response.QueueMessageId);
             }
         }, null);
     });
 }