Route#

class eclypse.remote.communication.route.Route[source]#

Bases: object

A route which connects two neighbor services in an application.

It contains the sender and recipient IDs, the sender and recipient node IDs, the list of hops (i.e., triplets denoting source node of the hop, target node of the hop, and cost of the link).

Methods

__init__(sender_id, sender_node_id, ...[, hops])

cost(msg)

Returns a function that computes the cost of the route for a given object.

Attributes

sender_id

The ID of the sender service.

sender_node_id

The ID of the infrastructure node hosting the sender service.

recipient_id

The ID of the recipient service.

recipient_node_id

The ID of the infrastructure node hosting the recipient service.

processing_time

The processing time contributed by the nodes traversed by the route.

hops

The ordered infrastructure hops of the route.

network_cost

Returns the network cost of the route.

no_hop

Returns True if the sender and recipient are deployed on the same node.

sender_id: str#

The ID of the sender service.

sender_node_id: str#

The ID of the infrastructure node hosting the sender service.

recipient_id: str#

The ID of the recipient service.

recipient_node_id: str#

The ID of the infrastructure node hosting the recipient service.

processing_time: float#

The processing time contributed by the nodes traversed by the route.

__init__(sender_id, sender_node_id, recipient_id, recipient_node_id, processing_time, hops=<factory>)#
Parameters:
  • sender_id (str)

  • sender_node_id (str)

  • recipient_id (str)

  • recipient_node_id (str)

  • processing_time (float)

  • hops (list[tuple[str, str, dict[str, Any]]])

Return type:

None

hops: list[tuple[str, str, dict[str, Any]]]#

The ordered infrastructure hops of the route.

cost(msg)[source]#

Returns a function that computes the cost of the route for a given object.

The object must be dict-like (i.e., it must have a __dict__ method).

Parameters:

msg (Any) – The object for which to compute the cost (e.g., a message).

Returns:

The function that computes the cost of the route.

Return type:

float

property network_cost#

Returns the network cost of the route.

The network cost is computed as the sum of the costs of the links in the route.

Returns:

The network cost.

Return type:

float

property no_hop: bool#

Returns True if the sender and recipient are deployed on the same node.

Returns:

True if the sender and recipient are deployed on the same node, False otherwise.

Return type:

bool