Bitcoin Core 31.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
mp::ProxyServer< Thread > Struct Referencefinal

#include <proxy-io.h>

Inheritance diagram for mp::ProxyServer< Thread >:
[legend]
Collaboration diagram for mp::ProxyServer< Thread >:
[legend]

Public Member Functions

 ProxyServer (Connection &connection, ThreadContext &thread_context, std::thread &&thread)
 
 ~ProxyServer ()
 
kj::Promise< void > getName (GetNameContext context) override
 
template<typename T , typename Fn >
kj::Promise< T > post (Fn &&fn)
 Run a callback function fn returning T on this thread. More...
 

Public Attributes

EventLoopRef m_loop
 
ThreadContextm_thread_context
 
std::thread m_thread
 
kj::Promise< void > m_thread_ready {kj::READY_NOW}
 Promise signaled when m_thread_context.waiter is ready and there is no post() callback function waiting to execute. More...
 

Detailed Description

Definition at line 95 of file proxy-io.h.

Constructor & Destructor Documentation

◆ ProxyServer()

mp::ProxyServer< Thread >::ProxyServer ( Connection connection,
ThreadContext thread_context,
std::thread &&  thread 
)

Definition at line 369 of file proxy.cpp.

Here is the call graph for this function:

◆ ~ProxyServer()

mp::ProxyServer< Thread >::~ProxyServer ( )

Reset thread context waiter pointer, as shutdown signal for done lambda passed as waiter->wait() argument in makeThread code below.

Assert waiter is idle. This destructor shouldn't be getting called if it is busy.

Ping waiter.

Definition at line 375 of file proxy.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ getName()

kj::Promise< void > mp::ProxyServer< Thread >::getName ( GetNameContext  context)
override

Definition at line 404 of file proxy.cpp.

◆ post()

template<typename T , typename Fn >
kj::Promise< T > mp::ProxyServer< Thread >::post ( Fn &&  fn)

Run a callback function fn returning T on this thread.

The function will be queued and executed as soon as the thread is idle, and when fn returns, the promise returned by this method will be fulfilled with the value fn returned.

Definition at line 717 of file proxy-io.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_loop

EventLoopRef mp::ProxyServer< Thread >::m_loop

Definition at line 109 of file proxy-io.h.

◆ m_thread

std::thread mp::ProxyServer< Thread >::m_thread

Definition at line 111 of file proxy-io.h.

◆ m_thread_context

ThreadContext& mp::ProxyServer< Thread >::m_thread_context

Definition at line 110 of file proxy-io.h.

◆ m_thread_ready

kj::Promise<void> mp::ProxyServer< Thread >::m_thread_ready {kj::READY_NOW}

Promise signaled when m_thread_context.waiter is ready and there is no post() callback function waiting to execute.

Definition at line 114 of file proxy-io.h.


The documentation for this struct was generated from the following files: