Blacker.MangaScraper.Helpers.AsyncRequestQueue.Add C# (CSharp) Method

Add() public method

public Add ( Func method, Exception>.Action callback ) : void
method Func
callback Exception>.Action
return void
        public void Add(Func<object> method, Action<object, Exception> callback)
        {
            if (method == null)
                throw new ArgumentNullException("method");
            if (callback == null)
                throw new ArgumentNullException("callback");
            if (!_initialized)
                throw new InvalidOperationException("Not initialized!");

            _requestQueue.Enqueue(new AsyncRequest() { Method = method, Callback = callback });
            _canProcess.Set();
        }