Click or drag to resize

IOperationServiceRegisterExternalOperation Method

Exposes a custom operation to be available for call by other plugins. The registration is not permanent, it holds true until disposing the return value, or plugin shutdown.

Namespace:  Resto.Front.Api
Assembly:  Resto.Front.Api.V6 (in Resto.Front.Api.V6.dll)
Syntax
C#
IDisposable RegisterExternalOperation(
	string serviceName,
	string operationName,
	RemotableFunc<byte[], byte[]> callback
)

Parameters

serviceName
Type: SystemString
Identifies the external service, just a namespace for a set of interrelated operations, which helps to group them logically. It's recommended to choose a unique name to avoid collisions with other plugins, i.e. include company's name or plugin's name into the service name. Min length is 1, max length is 50 chars.
operationName
Type: SystemString
In aggregate with [!:serviceName] identifies the operation. Both names have to be pre-shared with consumer plugins, so that they will be able to call the operation referring it by service and operation name. The combination of a service name and operation name must be unique at the same time. Min length is 1, max length is 50 chars.
callback
Type: Resto.Front.Api.RemotingHelpersRemotableFuncByte, Byte
The operation implementation, which will be called by other plugins via CallExternalOperation(String, String, Byte).

Return Value

Type: IDisposable
Remarks
Different plugins running under the same iikoFront application instance can communicate via external operations. iikoFront just transfers requests and responses between plugins without knowing any details. Both producer and consumer plugins should understand the data structure, developers should negotiate a protocol specification, pre-share operation names, handle versioning and so on. Producer plugin registers an operation using RegisterExternalOperation(String, String, RemotableFuncByte, Byte) and consumer plugin call it using CallExternalOperation(String, String, Byte).
See Also