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

Streamline documentation of `middleman_actor`

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