207 if (m_backpressure_strategy.has_value()) {
208 iox2_port_factory_client_builder_backpressure_strategy(
209 &m_handle,
static_cast<iox2_backpressure_strategy_e
>(bb::into<int>(m_backpressure_strategy.value())));
211 if (m_max_slice_len.has_value()) {
212 iox2_port_factory_client_builder_set_initial_max_slice_len(&m_handle, m_max_slice_len.value());
214 iox2_port_factory_client_builder_set_initial_max_slice_len(&m_handle, 1);
216 if (m_allocation_strategy.has_value()) {
217 iox2_port_factory_client_builder_set_allocation_strategy(
218 &m_handle, bb::into<iox2_allocation_strategy_e>(m_allocation_strategy.value()));
220 if (m_override_preallocation_callback.has_value()) {
225 iox2_port_factory_client_builder_override_requests_preallocation(
229 if (m_request_degradation_handler.has_value()) {
230 iox2_port_factory_client_builder_set_request_degradation_handler(
234 if (m_response_degradation_handler.has_value()) {
235 iox2_port_factory_client_builder_set_response_degradation_handler(
238 static_cast<void*
>(m_response_degradation_handler.value()));
241 if (m_backpressure_handler.has_value()) {
242 iox2_port_factory_client_builder_set_backpressure_handler(
246 if (m_max_active_requests.has_value()) {
247 iox2_port_factory_client_builder_set_max_active_requests(&m_handle, m_max_active_requests.value());
250 iox2_client_h client_handle {};
251 auto result = iox2_port_factory_client_builder_create(m_handle,
nullptr, &client_handle);
253 if (result == IOX2_OK) {
257 return bb::err(bb::into<ClientCreateError>(result));
auto create() &&-> bb::Expected< Client< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >, ClientCreateError >
Creates a new [Client] or returns a [ClientCreateError] on failure.