Server to server communication module
Author(s): Arsen Kostenko.
This module describes server-2-server side behavior of any node. Since this includes various communication and inspection tasks that should be performed in parallel, this module makes extensive usage of Ciao threading mechanism. On the other hand, module must be as simple as possible in terms of usage. Therefore, only a single predicate dht_s2s_main/0 is exposed to outer world and rest of complexity is hidden inside. This predicate is used from dht_server.pl module. All the parameters are passed through dht_config.pl module.
Usage and interface
- Library usage:
:- use_module(library(dht_s2s)). - Exports:
- Predicates:
dht_s2s_main/0.
- Predicates:
- Imports:
- System library modules:
sockets/sockets, system, concurrency/concurrency, dht/dht_config, dht/dht_misc, dht/dht_logic. - Packages:
prelude, nonpure, assertions, regtypes, isomodes.
- System library modules:
Documentation on exports
PREDICATE
Generally speaking, this predicate must perform some conventional tasks like:
- set local part of DHT to initial state,
- contact a successor node if there is any,
- and finally launch several threads that listen to streams, process incoming requests and inspect state of local finger-table.