Skip to content

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Factory to create a new client port/endpoint for TMessagingPattern.RequestResponse based communication.

Definition

Unit: Neslib.Iceoryx2.RequestResponse

type TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr> = record ... end;

Type Parameters

TReqPayl:

TReqUsrHdr:

TRespPayl:

TRespUsrHdr:

Nested Types

Name Description
PRequestPayload
PRequestUserHeader
PResponsePayload
PResponseUserHeader
TRequestPayload
TRequestUserHeader
TResponsePayload
TResponseUserHeader

Methods

Name Description
AllocationStrategy Defines the allocation strategy that is used when the provided InitialMaxSliceLen is exhausted. This happens when the user acquires more than max slice len in TClient.LoanSlice or TClient.LoanSliceUninit.
BackpressureStrategy Sets the TBackpressureStrategy which defines how the TClient shall behave when a TServer cannot receive a TRequestMut since its internal buffer is full.
Create Creates a new TClient or returns a TClientCreateError on failure.
InitialMaxSliceLen Sets the maximum number of elements that can be loaned in a slice.
MaxActiveRequests Defines the required maximal amount of active requests the TClient can send. Smallest possible value is 1.
Name The TPortName that shall be assigned to the TClient. It does not have to be unique. If no TPortName is defined then the TClient does not have a name.
OverrideRequestPreallocation Defines a callback to reduce the number of preallocated TRequestMut's. The input argument is the worst case number of preallocated TRequestMut's required to guarantee that the TClient never runs out of TRequestMut's to loan and send. The return value is clamped between 1 and the worst case number of preallocated TRequestMut's.
SetBackpressureHandler Sets the TBackpressureHandler of the TClient. Whenever a TRequestMut cannot be sent to a TServer, this handler is called and depending on the returned TBackpressureAction, measures will be taken. If no handler is set, the measures will be determined by the value set in TBackpressureStrategy.
SetRequestDegradationHandler Sets the TDegradationHandler for sending TRequestMut from the TClient. Whenever a request connection to a TServer is corrupted, this handler is called and depending on the returned TDegradationAction measures will be taken.
SetResponseDegradationHandler Sets the TDegradationHandler for receiving TResponse's from a TServer. Whenever a response connection to a TServer is corrupted, this handler is called and depending on the returned TDegradationAction measures will be taken.

Method Descriptions

AllocationStrategy(TAllocationStrategy)

Defines the allocation strategy that is used when the provided InitialMaxSliceLen is exhausted. This happens when the user acquires more than max slice len in TClient.LoanSlice or TClient.LoanSliceUninit.

function AllocationStrategy(const AValue: TAllocationStrategy): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: TAllocationStrategy

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Remarks

Can only used when TRequestPayload is a slice (TSlice). This is checked with an assertion.


BackpressureStrategy(TBackpressureStrategy)

Sets the TBackpressureStrategy which defines how the TClient shall behave when a TServer cannot receive a TRequestMut since its internal buffer is full.

function BackpressureStrategy(const AValue: TBackpressureStrategy): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: TBackpressureStrategy

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>


Create

Creates a new TClient or returns a TClientCreateError on failure.

function Create: TResult<TClient<TReqPayl>, TClientCreateError>

Returns

TResult<TClient<TReqPayl>, TClientCreateError>


InitialMaxSliceLen(UInt64)

Sets the maximum number of elements that can be loaned in a slice.

function InitialMaxSliceLen(const AValue: UInt64): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: UInt64

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Remarks

Can only used when TRequestPayload is a slice (TSlice). This is checked with an assertion.


MaxActiveRequests(Int64)

Defines the required maximal amount of active requests the TClient can send. Smallest possible value is 1.

function MaxActiveRequests(const AValue: Int64): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: Int64

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>


Name(TPortName)

The TPortName that shall be assigned to the TClient. It does not have to be unique. If no TPortName is defined then the TClient does not have a name.

function Name(const AValue: TPortName): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: TPortName

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>


OverrideRequestPreallocation(TOverridePreallocationCallback)

Defines a callback to reduce the number of preallocated TRequestMut's. The input argument is the worst case number of preallocated TRequestMut's required to guarantee that the TClient never runs out of TRequestMut's to loan and send. The return value is clamped between 1 and the worst case number of preallocated TRequestMut's.

function OverrideRequestPreallocation(const AValue: TOverridePreallocationCallback): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: TOverridePreallocationCallback

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Remarks

IMPORTANT: If the user reduces the number of preallocated TRequestMut's, iceoryx2 can no longer guarantee, that the TClient can always loan a TRequestMut to send.


SetBackpressureHandler(TBackpressureHandler)

Sets the TBackpressureHandler of the TClient. Whenever a TRequestMut cannot be sent to a TServer, this handler is called and depending on the returned TBackpressureAction, measures will be taken. If no handler is set, the measures will be determined by the value set in TBackpressureStrategy.

function SetBackpressureHandler(const AValue: TBackpressureHandler): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: TBackpressureHandler

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Remarks

The handler function needs to live as long as the generated client. If the TClient, including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data


SetRequestDegradationHandler(TDegradationHandler)

Sets the TDegradationHandler for sending TRequestMut from the TClient. Whenever a request connection to a TServer is corrupted, this handler is called and depending on the returned TDegradationAction measures will be taken.

function SetRequestDegradationHandler(const AValue: TDegradationHandler): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: TDegradationHandler

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Remarks

The handler function needs to live as long as the generated client. If the TClient, including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data


SetResponseDegradationHandler(TDegradationHandler)

Sets the TDegradationHandler for receiving TResponse's from a TServer. Whenever a response connection to a TServer is corrupted, this handler is called and depending on the returned TDegradationAction measures will be taken.

function SetResponseDegradationHandler(const AValue: TDegradationHandler): TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>; inline

Parameters

AValue: TDegradationHandler

Returns

TPortFactoryClient<TReqPayl, TReqUsrHdr, TRespPayl, TRespUsrHdr>

Remarks

The handler function needs to live as long as the generated client. If the TClient, including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data