Narrative documentation

Exchanging events

The communication between gobj’s happens via event’s. There are four main methods to do that:

send_event and post_event are used for send events to some gobj you know, basically yourself or your childs.

subscribe_event are used for subscribe to some output events of a gobj.

broadcast_event are used to inform all subscribed gobjs of the events occurred.

Exchanging events between gaplics

_images/gaplic-router.png

GRouter has a listening socket, within a range of ports known, to establish a channel with others host’s gaplic.

When a gaplic receives a event with destination to a compound unique-named-gobj, the gaplic interprets that the first part of the compound name is the name of a gaplic that belongs to other host.

The gaplic send the event to his GRouter, and these router sends the event to the destination gaplic.

Use this methods to send and receive events from others gaplics:

  • ginsfsm.gaplic.GAplic.send_event_to_external_gaplic()
  • ginsfsm.gaplic.GAplic.send_event_to_external_role()
  • ginsfsm.gaplic.GAplic.subscribe_event_from_external_gaplic()
  • ginsfsm.gaplic.GAplic.subscribe_event_from_external_role()
  • ginsfsm.gaplic.GAplic.unsubscribe_event_from_external_gaplic()
  • ginsfsm.gaplic.GAplic.unsubscribe_event_from_external_role()