Runs pw_rpc services on a pw::rpc2::Server without an existing pw::rpc::Server.
Use this when adapted services only need to serve pw_rpc2 clients, and use Rpc2ServerAdapter when adapted services also serve pw_rpc clients on an existing pw::rpc::Server. Register services with this adapter using Rpc2ServiceFor.
Like Rpc2ServerAdapter, it must never be destroyed if the pw_thread backend does not support joining.
Public Member Functions | |
| Rpc2Adapter (Allocator &allocator, const thread::Options &options, const Rpc2AdapterConfig &config=Rpc2AdapterConfig()) | |
Public Member Functions inherited from pw::rpc::Rpc2ServerAdapter | |
| Rpc2ServerAdapter (Server &server, Allocator &allocator, const thread::Options &options, const Rpc2AdapterConfig &config=Rpc2AdapterConfig()) | |
| ~Rpc2ServerAdapter () | |
| Rpc2ServerAdapter (const Rpc2ServerAdapter &)=delete | |
| Rpc2ServerAdapter & | operator= (const Rpc2ServerAdapter &)=delete |
| template<int &... kExplicitGuard, bool kJoiningEnabled = PW_THREAD_JOINING_ENABLED> | |
| void | Stop () |
|
inline |
Creates an adapter and starts the worker thread that runs pw_rpc handlers for pw_rpc2 clients.
| [in] | allocator | Buffers in-flight packets and holds per-connection state. Accessed under the adapter's lock, so it need not be thread-safe unless shared outside the adapter. |
| [in] | options | Options for the worker thread. Anything options references (such as a stack or thread context) must outlive the adapter. |
| [in] | config | Channel assignment and buffering limits. |