Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 1.44 KB

basic_concepts.md

File metadata and controls

25 lines (22 loc) · 1.44 KB

Basic concepts

The main message-io entity is the node. It is in charge of managing the different connections, performing actions over them and offering the events comming from the network or by the own node (called signals).

It is splitted in two sides:

  • NodeHandler: the "input" side, that performs actions. Theses actions can be network actions, send signals, or stop the NodeListener. This entity is clonable and sharable among threads, so you can send messages/signals anywhere from your program.
  • NodeListener: the "output" side, that receives events synchronized from one callback.

And each side has two main entities:

  • A synchronized queue (EventSender and EventReceiver) to send and receive signals from the own node. This is useful to make sending rates, messages based on timeouts, etc.
  • The network that is splited in a NetworkController to perform actions, and a NetworkProcessor to receive events from the network. The actions could be create any number of connections/listener, remove them or sending messages. The connections are managed by the network and identified by an Endpoint, that is a few copiable/hashable struct that represent those connections uniquely. It can be understood as the remitter/recipient of the message.