예제 #1
0
        public async Task <bool> RemoveJobAsync(string name)
        {
            var eventArgs = new RemoveJobEventArgs(name);

            JobRemoved?.Invoke(this, eventArgs);

            return(await(eventArgs.Success ?? Task.FromResult(false)).ConfigureAwait(false));
        }
예제 #2
0
        public void remove(string key) //Se non riesce a poppae nulla restituisce void e mette a dormire il consumer
        {
            Job j = null;

            list.TryRemove(key, out j);
            if (j != null)
            {
                JobRemoved?.Invoke(j);
            }
        }
예제 #3
0
        void OnJobFinished(object o, EventArgs args)
        {
            var job = o as Job;

            lock (jobs) {
                jobs.Remove(job);
            }

            JobRemoved?.Invoke(job);

            Schedule();
        }