Package com.swiftmq.swiftlet.threadpool
Class ThreadpoolSwiftlet
java.lang.Object
com.swiftmq.swiftlet.Swiftlet
com.swiftmq.swiftlet.threadpool.ThreadpoolSwiftlet
The ThreadpoolSwiftlet manages threads of a SwiftMQ router.
- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2005, All Rights Reserved
-
Field Summary
Fields inherited from class com.swiftmq.swiftlet.Swiftlet
STATE_ACTIVE, STATE_INACTIVE, STATE_STANDBY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract EventLoop
createEventLoop
(String id, EventProcessor processor) Create a new event loop.abstract void
freeze()
Freeze all event loops and async thread pools.abstract CompletableFuture
<?> Executes a Runnable in a separate virtual thread.abstract CompletableFuture
<?> Executes a Runnable in a separate virtual or platform thread.abstract void
unfreeze()
Unfreeze all event loops and async thread pools.Methods inherited from class com.swiftmq.swiftlet.Swiftlet
getName, getStartupTime, getState, isSnapshotAvailable, resume, setStartupTime, shutdown, standby, startup
-
Constructor Details
-
ThreadpoolSwiftlet
public ThreadpoolSwiftlet()
-
-
Method Details
-
runAsync
Executes a Runnable in a separate virtual thread.- Parameters:
r
- Runnable- Returns:
- Future to track completion
-
runAsync
Executes a Runnable in a separate virtual or platform thread.- Parameters:
r
- Runnablevirtual
- If true, uses a virtual, if false, uses a platform thread- Returns:
- Future to track completion
-
createEventLoop
Create a new event loop.- Parameters:
id
- id of the clientprocessor
- The processor that executes the tasks- Returns:
- A new Event Loop
-
freeze
public abstract void freeze()Freeze all event loops and async thread pools. -
unfreeze
public abstract void unfreeze()Unfreeze all event loops and async thread pools.
-