Ejemplo n.º 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));
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
        void OnJobFinished(object o, EventArgs args)
        {
            var job = o as Job;

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

            JobRemoved?.Invoke(job);

            Schedule();
        }