Manager provides an in-memory implementation for Raft networking and client creation.
More...
#include <manager.hpp>
|
virtual tl::expected< std::shared_ptr< Network >, Error > | createNetwork (NetworkCreateConfig const &config)=0 |
|
virtual tl::expected< std::shared_ptr< ClientFactory >, Error > | createClientFactory (std::string const &clientAddress)=0 |
|
virtual tl::expected< void, Error > | detachNetwork (std::string const &address)=0 |
|
virtual tl::expected< void, Error > | attachNetwork (std::string const &address)=0 |
|
Manager provides an in-memory implementation for Raft networking and client creation.
The Manager coordinates the creation of both networks and clients that can communicate with each other through shared memory rather than network protocols.
◆ attachNetwork()
virtual tl::expected< void, Error > raft::inmemory::Manager::attachNetwork |
( |
std::string const & |
address | ) |
|
|
pure virtual |
Re-attaches a previously detached network node, restoring communication.
- Parameters
-
address | The address of the node to attach. |
◆ createNetwork()
virtual tl::expected< std::shared_ptr< Network >, Error > raft::inmemory::Manager::createNetwork |
( |
NetworkCreateConfig const & |
config | ) |
|
|
pure virtual |
Creates a new in-memory network instance.
The created network will handle Raft protocol messages (AppendEntries, RequestVote) through direct method calls rather than network communication. Each network will be attached to the fabric upon calling the network's start() method.
- Parameters
-
config | Configuration containing the service handler for processing requests |
- Returns
- A shared pointer to the network instance or an error if creation fails
◆ detachNetwork()
virtual tl::expected< void, Error > raft::inmemory::Manager::detachNetwork |
( |
std::string const & |
address | ) |
|
|
pure virtual |
Detaches a network from the in-memory fabric, preventing it from sending or receiving messages.
- Parameters
-
address | The address of the node to detach or an error |
The documentation for this class was generated from the following file:
- /home/runner/work/raft/raft/include/raft/inmemory/manager.hpp