EclypseCommunicationInterface#

class eclypse.remote.communication.interface.EclypseCommunicationInterface[source]#

Bases: object

EclypseCommunicationInterface class.

It is used to implement and simulate the interactions between services deployed and running in the same infrastructure.

It allows to interact with the RemoteSimulator, which provides the details regarding the current state of the infrastructure, and simulate the behaviour of the services accordingly.

Methods

__init__(service)

Initializes the communication interface.

connect()

Connects the communication interface to the RemoteSimulator.

disconnect()

Disconnects the communication interface from the RemoteSimulator.

get_neighbors()

Interact with the InfrastructureManager to request service neighbours.

request_route(recipient_id)

Interact with the RemoteSimulator to request a service route.

Attributes

connected

Return True if the communication interface is connected to the simulator.

service

Returns the service leveraging the communication interface.

__init__(service)[source]#

Initializes the communication interface.

Parameters:

service (Service) – The service that uses the communication interface.

connect()[source]#

Connects the communication interface to the RemoteSimulator.

disconnect()[source]#

Disconnects the communication interface from the RemoteSimulator.

request_route(recipient_id)[source]#

Interact with the RemoteSimulator to request a service route.

The result of the function can be obtained by calling ray.get or by awaiting it.

Parameters:

recipient_id (str) – The ID of the recipient service.

Returns:

The route to the recipient service.

Return type:

Task[Route]

get_neighbors()[source]#

Interact with the InfrastructureManager to request service neighbours.

The result of the function can be obtained by calling ray.get or by awaiting it.

Returns:

The list of neighbor service IDs.

Return type:

Task[list[str]]

property connected: bool#

Return True if the communication interface is connected to the simulator.

Returns:

True if the communication interface is connected.

Return type:

bool

property service: Service#

Returns the service leveraging the communication interface.

Returns:

The service leveraging the communication interface.

Return type:

Service