mirror of https://github.com/oxen-io/lokinet
make event loop pump function non idempotent
This commit is contained in:
parent
8744c93944
commit
bb86996acf
|
@ -69,16 +69,7 @@ namespace llarp
|
|||
_running.store(false);
|
||||
_lastTick = llarp::time_now_ms();
|
||||
m_NextExploreAt = Clock_t::now();
|
||||
m_Pump = _loop->make_waker([this]() {
|
||||
llarp::LogTrace("Router::PumpLL() start");
|
||||
if (_stopping.load())
|
||||
return;
|
||||
paths.PumpDownstream();
|
||||
paths.PumpUpstream();
|
||||
_outboundMessageHandler.Tick();
|
||||
_linkManager.PumpLinks();
|
||||
llarp::LogTrace("Router::PumpLL() end");
|
||||
});
|
||||
m_Pump = _loop->make_waker([this]() { PumpLLNonIdempotent(); });
|
||||
}
|
||||
|
||||
Router::~Router()
|
||||
|
@ -86,6 +77,19 @@ namespace llarp
|
|||
llarp_dht_context_free(_dht);
|
||||
}
|
||||
|
||||
void
|
||||
Router::PumpLLNonIdempotent()
|
||||
{
|
||||
llarp::LogTrace("Router::PumpLL() start");
|
||||
if (_stopping.load())
|
||||
return;
|
||||
paths.PumpDownstream();
|
||||
paths.PumpUpstream();
|
||||
_outboundMessageHandler.Tick();
|
||||
_linkManager.PumpLinks();
|
||||
llarp::LogTrace("Router::PumpLL() end");
|
||||
}
|
||||
|
||||
util::StatusObject
|
||||
Router::ExtractStatus() const
|
||||
{
|
||||
|
@ -1241,9 +1245,9 @@ namespace llarp
|
|||
|
||||
#ifdef _WIN32
|
||||
// windows uses proactor event loop so we need to constantly pump
|
||||
_loop->add_ticker([this] { PumpLL(); });
|
||||
_loop->add_ticker([this] { PumpLLNonIdempotent(); });
|
||||
#else
|
||||
_loop->set_pump_function([this] { PumpLL(); });
|
||||
_loop->set_pump_function([this] { PumpLLNonIdempotent(); });
|
||||
#endif
|
||||
_loop->call_every(ROUTER_TICK_INTERVAL, weak_from_this(), [this] { Tick(); });
|
||||
_running.store(true);
|
||||
|
|
|
@ -286,6 +286,9 @@ namespace llarp
|
|||
void
|
||||
PumpLL() override;
|
||||
|
||||
void
|
||||
PumpLLNonIdempotent();
|
||||
|
||||
const oxenmq::address DefaultRPCBindAddr = oxenmq::address::tcp("127.0.0.1", 1190);
|
||||
bool enableRPCServer = false;
|
||||
oxenmq::address rpcBindAddr = DefaultRPCBindAddr;
|
||||
|
|
Loading…
Reference in New Issue