Commit 5370dd5d authored by Dominik Charousset's avatar Dominik Charousset

Streamline documentation of `middleman_actor`

parent 1994bbbb
......@@ -31,61 +31,75 @@ namespace io {
*
* The interface implements the following pseudo code.
* ~~~
* interface middleman_actor {
* using put_result = either (ok_atom, uint16_t port)
* or (error_atom, std::string error_string);
* using put_result =
* either (ok_atom, uint16_t port)
* or (error_atom, string error_string);
*
* put_result <- (put_atom, actor_addr whom, uint16_t port,
* std::string addr, bool reuse_addr);
* using get_result =
* either (ok_atom, actor_addr remote_address)
* or (error_atom, string error_string);
*
* put_result <- (put_atom, actor_addr whom,
* uint16_t port, std::string addr);
* using delete_result =
* either (ok_atom)
* or (error_atom, string error_string);
*
* put_result <- (put_atom, actor_addr whom, uint16_t port, bool reuse_addr);
* interface middleman_actor {
* (put_atom, actor_addr whom, uint16_t port, string addr, bool reuse_addr)
* -> put_result;
*
* put_result <- (put_atom, actor_addr whom, uint16_t port);
* (put_atom, actor_addr whom, uint16_t port, string addr)
* -> put_result;
*
* using get_result = either (ok_atom, actor_addr remote_address)
* or (error_atom, std::string error_string);
* (put_atom, actor_addr whom, uint16_t port, bool reuse_addr)
* -> put_result;
*
* get_result <- (get_atom, std::string hostname, uint16_t port);
* (put_atom, actor_addr whom, uint16_t port)
* -> put_result;
*
* get_result <- (get_atom, std::string hostname, uint16_t port,
* std::set<std::string> expected_ifs);
* (get_atom, string hostname, uint16_t port)
* -> get_result;
*
* using delete_result = either (ok_atom)
* or (error_atom, std::string error_string);
* (get_atom, string hostname, uint16_t port, set<string> expected_ifs)
* -> get_result;
*
* delete_result <- (delete_atom, actor_addr whom);
* (delete_atom, actor_addr whom)
* -> delete_result;
*
* delete_result <- (delete_atom, actor_addr whom, uint16_t port);
* (delete_atom, actor_addr whom, uint16_t port)
* -> delete_result;
* }
* ~~~
*
* The `middleman_actor` actor offers the following operations:
* * `PUT` establishes a new `port <-> actor` mapping and returns the actual
* port in use on success. When passing 0 as `port` parameter,
* this is the only way to learn which port was used.
* Parameter | Description
* --------------|------------------------------------------------------------
* whom | Actor that should be published at port.
* port | Unused TCP port or 0 for any.
* addr | Optional; the IP address to listen to or INADDR_ANY
* reuse_addr | Optional; enable SO_REUSEPORT option (default: false)
* * `GET` queries remote node and returns an `actor_addr` to the remote
* actor on success. This handle must be cast to either `actor` or
* `typed_actor` using `actor_cast`.
* Parameter | Description
* --------------|------------------------------------------------------------
* hostname | Valid hostname or IP address.
* port | TCP port.
* expected_ifs | Optional; Interface of typed remote actor.
* * `DELETE` removes either all `port <-> actor` mappings for an actor or
* only a single one if the optional `port` parameter is set.
* Parameter | Description
* --------------|------------------------------------------------------------
* whom | Published actor.
* port | Optional; remove only a single mapping.
* - `PUT` establishes a new `port <-> actor`
* mapping and returns the actual port in use on success.
* Passing 0 as port instructs the OS to choose the next high-level port
* available for binding.
* Type | Name | Parameter Description
* -----------|------------|--------------------------------------------------
* put_atom | | Identifies `PUT` operations.
* actor_addr | whom | Actor that should be published at given port.
* uint16_t | port | Unused TCP port or 0 for any.
* string | addr | Optional; IP address to listen to or `INADDR_ANY`
* bool | reuse_addr | Optional; enable SO_REUSEPORT option
*
* - `GET` queries a remote node and returns an `actor_addr` to the remote actor
* on success. This handle must be cast to either `actor` or `typed_actor`
* using `actor_cast`.
* Type | Name | Parameter Description
* ------------|-------------|------------------------------------------------
* get_atom | | Identifies `GET` operations.
* string | hostname | Valid hostname or IP address.
* uint16_t | port | TCP port.
* set<string> | expected_ifs | Optional; Interface of typed remote actor.
*
* - `DELETE` removes either all `port <-> actor` mappings for an actor or only
* a single one if the optional `port` parameter is set.
* Type | Name | Parameter Description
* ------------|-------------|------------------------------------------------
* delete_atom | | Identifies `DELETE` operations.
* actor_addr | whom | Published actor.
* uint16_t | port | Optional; remove only a single mapping.
*/
using middleman_actor =
typed_actor<
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment