Generally ThreadPoolExecutor accepts/access Queue<Runnable>. Is there any method that accepts/access a custom queue, i.e A queue of some object type Queue<some class object>?
Generally ThreadPoolExecutor accepts/access Queue<Runnable> . Is there any method that accepts/access a custom queue,
Share
No there aren’t any method with your
CustomObjectin it’s parameter.Runnableis an interface.You will actually pass a queue of your
CustomObjects as a queue ofRunnable.You just have to make sure that your
CustomObjectimplements theRunnableinterface.