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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...