libmuscle.native_instantiator.map_server module

class libmuscle.native_instantiator.map_server.MAPRequestHandler(agent_manager: IAgentManager, post_office: PostOffice)[source]

Bases: RequestHandler

Handles Agent requests.

handle_request(request: Buffer) Buffer[source]

Handles an agent request.

Parameters:

request – The encoded request

Returns:

An encoded response

Return type:

response

class libmuscle.native_instantiator.map_server.MAPServer(agent_manager: IAgentManager)[source]

Bases: object

The MUSCLE Agent Protocol server.

This class accepts connections from the agents and services them using a MAPRequestHandler.

deposit_command(node_name: str, command: AgentCommand) None[source]

Deposit a command for the given agent.

This takes the given command and queues it for the given agent to pick up next time it asks us for one.

Parameters:
  • node_name – Name of the node whose agent should execute the command

  • command – The command to send

get_location() str[source]

Return this server’s network location.

This is a string of the form tcp:<hostname>:<port>.

stop() None[source]

Stop the server.

This makes the server stop serving requests, and shuts down its background threads.