raft 0.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
raft::inmemory::Manager Class Referenceabstract

Manager provides an in-memory implementation for Raft networking and client creation. More...

#include <manager.hpp>

Public Member Functions

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
 

Detailed Description

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.

Member Function Documentation

◆ 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
addressThe 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
configConfiguration 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
addressThe address of the node to detach or an error

The documentation for this class was generated from the following file: