Class HttpActorServer
java.lang.Object
com.scivicslab.pojoactor.core.distributed.HttpActorServer
- All Implemented Interfaces:
AutoCloseable
HTTP server that receives actor invocation requests from remote nodes
and dispatches them to the local
ActorSystem.
Completes the server side of HttpTransport,
enabling direct node-to-node communication for HPC clusters (Slurm, Grid Engine).
Endpoint
POST /actor/{actorName}/invoke
Content-Type: application/json
{"actorName":"math","actionName":"add","args":"5,3","messageId":"uuid"}
Response:
{"success":true,"result":"8"}
Lifecycle
HttpActorServer server = new HttpActorServer(actorSystem, port);
server.start();
// ...
server.close();
- Since:
- 3.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionHttpActorServer(ActorSystem actorSystem, int port) Creates an HttpActorServer that listens on the given port. -
Method Summary
-
Constructor Details
-
HttpActorServer
Creates an HttpActorServer that listens on the given port.- Parameters:
actorSystem- the local actor system to dispatch messages toport- the port to listen on
-
-
Method Details
-
start
Starts the HTTP server. Registers a wildcard handler for/actor/.- Throws:
IOException- if the server cannot bind to the port
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-