public override IChoAbortableAsyncResult EnqueueMethod(Delegate func, object[] parameters, ChoAsyncCallback callback, object state, int timeout, int maxNoOfRetry, int sleepBetweenRetry)
        {
            ChoGuard.ArgumentNotNull(func, "Function");
            CheckTimeoutArg(timeout);

            ChoExecutionServiceData data = new ChoExecutionServiceData(func, parameters, timeout, new ChoAbortableAsyncResult(callback, state), maxNoOfRetry, sleepBetweenRetry);

            _queuedMsgService.Enqueue(ChoStandardQueuedMsgObject <ChoExecutionServiceData> .New(data));

            return(data.Result as IChoAbortableAsyncResult);
        }
Example #2
0
        public override IChoAsyncResult EnqueueMethod(Delegate func, object[] parameters, ChoAsyncCallback callback, object state, int timeout, int maxNoOfRetry, int sleepBetweenRetry)
        {
            ChoGuard.ArgumentNotNull(func, "Function");
            CheckTimeoutArg(timeout);

            if (ChoGuard.IsDisposed(this))
            {
                return(null);
            }

            timeout           = timeout > _timeout ? _timeout : timeout;
            maxNoOfRetry      = maxNoOfRetry > _maxNoOfRetry ? _maxNoOfRetry : maxNoOfRetry;
            sleepBetweenRetry = sleepBetweenRetry > _sleepBetweenRetry ? _sleepBetweenRetry : sleepBetweenRetry;

            ChoExecutionServiceData data = new ChoExecutionServiceData(func, parameters, timeout, new ChoAsyncResult(callback, state), maxNoOfRetry, sleepBetweenRetry);

            _queuedMsgService.Enqueue(ChoStandardQueuedMsgObject <ChoExecutionServiceData> .New(data));

            return(data.Result);
        }