public final class Port
extends java.lang.Object
A port is obtained from a worker environment when spawning a function. It can then be used to send messages that will be eventually processed by the target function. Messages are being put in a first-in, first-out queue.
Constructor and Description |
---|
Port(java.util.concurrent.ExecutorService executor,
WorkerFunction function)
Port constructor.
|
Modifier and Type | Method and Description |
---|---|
Port |
send(java.lang.Object message)
Sends a message to the target worker function.
|
public Port(java.util.concurrent.ExecutorService executor, WorkerFunction function)
executor
- the executor to dispatch the asynchronous message handling jobs to.function
- the target worker function.public Port send(java.lang.Object message)
message
- the message of any type.