RpcEndpoint

automorph.RpcEndpoint
See theRpcEndpoint companion object

RPC endpoint.

Used to handle remote API requests as part of an existing server and invoke bound API methods to process them.

Automatically derives remote API bindings for existing API instances.

Type parameters

Adapter

transport layer adapter type

Codec

message codec plugin type

Context

RPC message context type

Effect

effect type

Node

message node type

Value parameters

functions

bound RPC functions

handler

RPC request handler

rpcProtocol

RPC protocol plugin

transport

transport layer transport plugin

Attributes

Constructor

Creates a RPC endpoint with specified protocol and transport plugins supporting corresponding message context type.

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def adapter: Adapter

Transport layer adapter.

Transport layer adapter.

Attributes

def discovery(discovery: Boolean): RpcEndpoint[Node, Codec, Effect, Context, Adapter]

Enable or disable automatic provision of service discovery via RPC functions returning bound API schema.

Enable or disable automatic provision of service discovery via RPC functions returning bound API schema.

Value parameters

discovery

service discovery enabled

Attributes

Returns

RPC server

Inherited methods

inline def bind[Api <: AnyRef](api: Api, mapName: String => Iterable[String]): RpcEndpoint[Node, Codec, Effect, Context, Adapter]

Creates a copy of this endpoint with added RPC bindings for all public methods of the specified API instance.

Creates a copy of this endpoint with added RPC bindings for all public methods of the specified API instance.

The binding generation fails if any public API method has one of the following properties:

  • does not return the specified effect type
  • is overloaded
  • has type parameters
  • is inline

Bindings API methods using the names identical to already existing bindings replaces the existing bindings with the new bindings.

If the last parameter of bound method is of Context type or returns a context function accepting the Context type the endpoint-supplied ''request context'' is passed to the bound method or the returned context function as its last argument.

Bound API methods are exposed as RPC functions with their names transformed via the mapName function.

Type parameters

Api

API type (only member methods of this type are exposed)

Value parameters

api

API instance

mapName

maps bound API method name to the exposed RPC function names (empty result causes the method not to be exposed)

Attributes

Returns

RPC request endpoint with specified API bindings

Throws
IllegalArgumentException

if invalid public methods are found in the API type

Inherited from:
EndpointBind (hidden)
inline def bind[Api <: AnyRef](api: Api): RpcEndpoint[Node, Codec, Effect, Context, Adapter]

Creates a copy of this endpoint with added RPC bindings for all public methods of the specified API instance.

Creates a copy of this endpoint with added RPC bindings for all public methods of the specified API instance.

The binding generation fails if any public API method has one of the following properties:

  • does not return the specified effect type
  • is overloaded
  • has type parameters
  • is inline

Bindings API methods using the names identical to already existing bindings replaces * the existing bindings with the new bindings.

If the last parameter of bound method is of Context type or returns a context function accepting the Context type the endpoint-supplied ''request context'' is passed to the bound method or the returned context function as its last argument.

Type parameters

Api

API type (only member methods of this type are exposed)

Value parameters

api

API instance

Attributes

Returns

RPC request endpoint with specified API bindings

Throws
IllegalArgumentException

if invalid public methods are found in the API type

Inherited from:
EndpointBind (hidden)

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product