Seastar
High performance C++ framework for concurrent servers
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
seastar::rpc::client Class Reference
Inheritance diagram for seastar::rpc::client:
seastar::rpc::connection seastar::weakly_referencable< client > seastar::rpc::protocol< Serializer, MsgType >::client

Classes

struct  reply_handler
 

Public Member Functions

 client (const logger &l, void *s, const socket_address &addr, const socket_address &local={})
 
 client (const logger &l, void *s, client_options options, const socket_address &addr, const socket_address &local={})
 
 client (const logger &l, void *s, socket socket, const socket_address &addr, const socket_address &local={})
 
 client (const logger &l, void *s, client_options options, socket socket, const socket_address &addr, const socket_address &local={})
 
stats get_stats () const
 
statsget_stats_internal ()
 
auto next_message_id ()
 
void wait_for_reply (id_type id, std::unique_ptr< reply_handler_base > &&h, std::optional< rpc_clock_type::time_point > timeout, cancellable *cancel)
 
void wait_timed_out (id_type id)
 
future stop ()
 
void abort_all_streams ()
 
void deregister_this_stream ()
 
socket_address peer_address () const override
 
future await_connection ()
 
template<typename Serializer , typename... Out>
future< sink< Out... > > make_stream_sink (socket socket)
 
template<typename Serializer , typename... Out>
future< sink< Out... > > make_stream_sink ()
 
void set_socket (connected_socket &&fd)
 
future send_negotiation_frame (feature_map features)
 
future send (snd_buf buf, std::optional< rpc_clock_type::time_point > timeout={}, cancellable *cancel=nullptr)
 
bool error ()
 
void abort ()
 
future stream_receive (circular_buffer< foreign_ptr< std::unique_ptr< rcv_buf >>> &bufs)
 
future close_sink ()
 
bool sink_closed ()
 
future close_source ()
 
connection_id get_connection_id () const
 
xshard_connection_ptr get_stream (connection_id id) const
 
void register_stream (connection_id id, xshard_connection_ptr c)
 
const loggerget_logger () const
 
template<typename Serializer >
Serializer & serializer ()
 
template<typename FrameType >
FrameType::return_type read_frame (socket_address info, input_stream< char > &in)
 
template<typename FrameType >
FrameType::return_type read_frame_compressed (socket_address info, std::unique_ptr< compressor > &compressor, input_stream< char > &in)
 
weak_ptr< clientweak_from_this () noexcept
 

Protected Types

enum  outgoing_queue_type { request, response, stream = response }
 

Protected Member Functions

bool is_stream ()
 
snd_buf compress (snd_buf buf)
 
future send_buffer (snd_buf buf)
 
future stop_send_loop ()
 
future< std::optional< rcv_buf > > read_stream_frame_compressed (input_stream< char > &in)
 
bool stream_check_twoway_closed ()
 
future stream_close ()
 
future stream_process_incoming (rcv_buf &&)
 
future handle_stream_frame ()
 

Protected Attributes

connected_socket _fd
 
input_stream< char > _read_buf
 
output_stream< char > _write_buf
 
bool _error = false
 
bool _connected = false
 
promise _stopped
 
stats _stats
 
const logger_logger
 
void * _serializer
 
friend outgoing_entry
 
std::list< outgoing_entry_outgoing_queue
 
condition_variable _outgoing_queue_cond
 
future _send_loop_stopped = make_ready_future<>()
 
std::unique_ptr< compressor_compressor
 
bool _timeout_negotiated = false
 
bool _is_stream = false
 
connection_id _id = invalid_connection_id
 
std::unordered_map< connection_id, xshard_connection_ptr_streams
 
queue< rcv_buf_stream_queue = queue<rcv_buf>(max_queued_stream_buffers)
 
semaphore _stream_sem = semaphore(max_stream_buffers_memory)
 
bool _sink_closed = true
 
bool _source_closed = true
 
future< bool > _sink_closed_future = make_ready_future<bool>(false)
 

Constructor & Destructor Documentation

◆ client() [1/2]

seastar::rpc::client::client ( const logger l,
void *  s,
const socket_address addr,
const socket_address local = {} 
)

Create client object which will attempt to connect to the remote address.

Parameters
lseastar::logger to use for logging error messages
san optional connection serializer
addrthe remote address identifying this client
localthe local address of this client

◆ client() [2/2]

seastar::rpc::client::client ( const logger l,
void *  s,
socket  socket,
const socket_address addr,
const socket_address local = {} 
)

Create client object which will attempt to connect to the remote address using the specified seastar::socket.

Parameters
lseastar::logger to use for logging error messages
san optional connection serializer
addrthe remote address identifying this client
localthe local address of this client
socketthe socket object use to connect to the remote address

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