Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
5370dd5d
Commit
5370dd5d
authored
Jan 27, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Streamline documentation of `middleman_actor`
parent
1994bbbb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
41 deletions
+55
-41
libcaf_io/caf/io/middleman_actor.hpp
libcaf_io/caf/io/middleman_actor.hpp
+55
-41
No files found.
libcaf_io/caf/io/middleman_actor.hpp
View file @
5370dd5d
...
@@ -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
<
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment