Marco reference

class marcopolo.marco.marco.Marco[source]
__init__()[source]

Initializes all the data structures and sockets, setting timeouts and other socket options

marco(max_nodes=None, exclude=[], timeout=None, params={}, retries=0, group='224.0.0.112')[source]

Sends a marco message to all nodes, which reply with a Polo message. Upon receiving all responses (those arriving before the timeout), a collection of the response information is returned.

Parameters:
  • exclude (list) – List of nodes to be excluded from the returned ValueError.
  • timeout (int) – If set, overrides the default timeout value.
  • retries (int) – If set to a value greater than 0, retries the retries times if the first attempt is unsuccessful
  • max_nodes (int) – Maximum number of nodes to be returned. If set to None, no limit is applied.
Returns:

A list of all responding nodes.

request_for(service, node=None, max_nodes=None, exclude=[], params={}, timeout=None, group='224.0.0.112')[source]

Request all nodes offering a certain service or the details for one single node

Parameters:
  • service (string) – Name of the requested service
  • node (string) – Address or name of the desired node
Returns:

an array with all the available nodes

services(addr, timeout=None, retries=0)[source]

Searches for the services available in a certain node identified by its address

Parameters:
  • addr (string) – Address of the node
  • port (int) – UDP port of the Polo instance. If not given, the default is the port in the conffile
Returns:

An array with all detected nodes

class marcopolo.marco.marcobinding.MarcoBinding[source]

Twisted class for an asynchronous socket server