217 if (m_backpressure_strategy.has_value()) {
218 iox2_port_factory_client_builder_backpressure_strategy(
219 &m_handle,
static_cast<iox2_backpressure_strategy_e
>(bb::into<int>(m_backpressure_strategy.value())));
221 if (m_max_slice_len.has_value()) {
222 iox2_port_factory_client_builder_set_initial_max_slice_len(&m_handle, m_max_slice_len.value());
224 iox2_port_factory_client_builder_set_initial_max_slice_len(&m_handle, 1);
226 if (m_allocation_strategy.has_value()) {
227 iox2_port_factory_client_builder_set_allocation_strategy(
228 &m_handle, bb::into<iox2_allocation_strategy_e>(m_allocation_strategy.value()));
230 if (m_override_preallocation_callback.has_value()) {
235 iox2_port_factory_client_builder_override_requests_preallocation(
239 if (m_request_degradation_handler.has_value()) {
240 iox2_port_factory_client_builder_set_request_degradation_handler(
244 if (m_response_degradation_handler.has_value()) {
245 iox2_port_factory_client_builder_set_response_degradation_handler(
248 static_cast<void*
>(m_response_degradation_handler.value()));
251 if (m_backpressure_handler.has_value()) {
252 iox2_port_factory_client_builder_set_backpressure_handler(
256 if (m_max_active_requests.has_value()) {
257 iox2_port_factory_client_builder_set_max_active_requests(&m_handle, m_max_active_requests.value());
260 if (m_name.has_value()) {
261 const auto* name_ptr = m_name.value().as_view().native_ptr();
262 iox2_port_factory_client_builder_set_name(&m_handle, name_ptr);
265 iox2_client_h client_handle {};
266 auto result = iox2_port_factory_client_builder_create(m_handle,
nullptr, &client_handle);
268 if (result == IOX2_OK) {
272 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.