Jump to content
  • 0

Question

Posted

hello i need a help. how i can run a list from class with only one threadpool like

addRun(teleport(), 1000);

 

Class ThreadPool for run like

public void addRun(ClassRun, Time)
{
ThreadPool.schedule(() -> ClassRun, Time);
}

if can any help tnx.

2 answers to this question

Recommended Posts

  • 0
Posted

aCis edited most of the uses for () ->, you should check it there. If you got a single method to call it's nothing more than :

() -> methodToCall();

 

if you got more content to call, it will be :

() ->
{
	methodToCall();
	moreMethodToCall();
}

 

  • 0
Posted

aha nice but i need use different class + different time like first run 20 second and second run 1 minutes not in same time

like can run much public with only one threadpool but with different time

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock