Verified Commit 0ad18d79 authored by Alberto Miranda's avatar Alberto Miranda
Browse files

RPC handlers can now access server context

Our network interface now relies on Thallium's support for `providers`
(https://mochi.readthedocs.io/en/latest/thallium/09_providers.html).
This allows using the member functions from a class as RPC handlers,
which in turn allows RPC handers to access the class' data members.

Thus, we have heavily refactored `scord`:

- Create a new `scord::rpc_server` class that inherits both from
`network::server` and `network::provider`. This enables the
aforementioned functionality.
- The RPC handlers for `scord` are now member functions of
`scord::rpc_server` instead of free functions.
- The managers used by `scord` (i.e. the `job_manager`,
`adhoc_storage_manager`, and `pfs_storage_manager` are now members of
`scord::rpc_server` instead of singletons, since they no longer need to
be accessed globally.

Similarly for `scord-ctl`:
- Create a new `scord_ctl::rpc_server` class that inherits both from
`network::server` and `network::provider`. This enables the
aforementioned functionality.
- The RPC handlers for `scord-ctl` are now member functions of
`scord_ctl::rpc_server` instead of free functions.

Additionally, we have also moved the `network` and `logger` namespaces
outside of `scord`, since this code is shared by both `scord` and
`scord-ctl`.
parent b4e9cbde
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