236 if (m_backpressure_strategy.has_value()) {
237 iox2_port_factory_client_builder_backpressure_strategy(
238 &m_handle,
static_cast<iox2_backpressure_strategy_e
>(bb::into<int>(m_backpressure_strategy.value())));
240 if (m_max_slice_len.has_value()) {
241 iox2_port_factory_client_builder_set_initial_max_slice_len(&m_handle, m_max_slice_len.value());
243 iox2_port_factory_client_builder_set_initial_max_slice_len(&m_handle, 1);
245 if (m_allocation_strategy.has_value()) {
246 iox2_port_factory_client_builder_set_allocation_strategy(
247 &m_handle, bb::into<iox2_allocation_strategy_e>(m_allocation_strategy.value()));
249 if (m_override_preallocation_callback.has_value()) {
254 iox2_port_factory_client_builder_override_requests_preallocation(
258 if (m_request_degradation_handler.has_value()) {
259 iox2_port_factory_client_builder_set_request_degradation_handler(
263 if (m_response_degradation_handler.has_value()) {
264 iox2_port_factory_client_builder_set_response_degradation_handler(
267 static_cast<void*
>(m_response_degradation_handler.value()));
270 if (m_backpressure_handler.has_value()) {
271 iox2_port_factory_client_builder_set_backpressure_handler(
275 if (m_max_active_requests.has_value()) {
276 iox2_port_factory_client_builder_set_max_active_requests(&m_handle, m_max_active_requests.value());
279 if (m_name.has_value()) {
280 const auto* name_ptr = m_name.value().as_view().native_ptr();
281 iox2_port_factory_client_builder_set_name(&m_handle, name_ptr);
284 iox2_client_h client_handle {};
285 auto result = iox2_port_factory_client_builder_create(m_handle,
nullptr, &client_handle);
287 if (result == IOX2_OK) {
291 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.