Class HttpActorServer

java.lang.Object
com.scivicslab.pojoactor.core.distributed.HttpActorServer
All Implemented Interfaces:
AutoCloseable

public class HttpActorServer extends Object implements 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 Details

    • HttpActorServer

      public HttpActorServer(ActorSystem actorSystem, int port)
      Creates an HttpActorServer that listens on the given port.
      Parameters:
      actorSystem - the local actor system to dispatch messages to
      port - the port to listen on
  • Method Details

    • start

      public void start() throws IOException
      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:
      close in interface AutoCloseable