RpcClient

automorph.RpcClient
See theRpcClient companion object

RPC client.

Used to perform type-safe remote API calls or send one-way messages.

Remote APIs can be invoked via proxy instances automatically created from specified API trait or without an API trait by supplying the required type information on invocation.

Type parameters

Codec

message codec plugin type

Context

RPC message context type

Effect

effect type

Node

message node type

Value parameters

rpcProtocol

RPC protocol plugin

transport

client transport protocol plugin

Attributes

Constructor

Creates a RPC client with specified protocol and transport plugins providing 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 close(): Effect[RpcClient[Node, Codec, Effect, Context]]

Closes this client freeing the underlying resources.

Closes this client freeing the underlying resources.

Attributes

Returns

nothing

def context: Context

Creates a default request context.

Creates a default request context.

Attributes

Returns

request context

def init(): Effect[RpcClient[Node, Codec, Effect, Context]]

Starts this server to process incoming requests.

Starts this server to process incoming requests.

Attributes

Returns

active RPC server

override def performCall[Result](function: String, arguments: Seq[(String, Node)], decodeResult: (Node, Context) => Result, requestContext: Option[Context]): Effect[Result]

This method must never be used and should be considered private.

This method must never be used and should be considered private.

Attributes

Definition Classes
def tell(function: String): RemoteTell[Node, Codec, Effect, Context]

Creates a remote API function one-way message proxy.

Creates a remote API function one-way message proxy.

Uses the remote function name and arguments to send an RPC request without waiting for a response.

Value parameters

function

remote function name

Attributes

Returns

specified remote function one-way message proxy

Throws
RpcException

on RPC error

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

inline def bind[Api <: AnyRef](mapName: String => String): Api

Creates a remote API proxy with RPC bindings for all public methods of the specified API type.

Creates a remote API proxy with RPC bindings for all public methods of the specified API type.

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

If the last parameter of bound method is of Context type or returns a context function accepting the Context type the caller-supplied request context is passed to the underlying message transport plugin.

RPC functions defined by bound API methods are invoked with their names transformed via the mapName function.

Type parameters

Api

remote API trait type (classes are not supported)

Value parameters

mapName

maps bound API method name to the invoked RPC function name

Attributes

Returns

remote API proxy

Throws
java.lang.IllegalArgumentException

if invalid public methods are found in the API type

Inherited from:
ClientBase (hidden)
inline def bind[Api <: AnyRef]: Api

Creates a remote API proxy with RPC bindings for all public methods of the specified API type.

Creates a remote API proxy with RPC bindings for all public methods of the specified API type.

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

If the last parameter of bound method is of Context type or returns a context function accepting the Context type the caller-supplied request context is passed to the underlying message transport plugin.

Type parameters

Api

API trait type (classes are not supported)

Value parameters

mapName

maps API method name to the invoked RPC function name

Attributes

Returns

RPC API proxy

Throws
java.lang.IllegalArgumentException

if invalid public methods are found in the API type

Inherited from:
ClientBase (hidden)
inline def call[Result](function: String): RemoteCall[Node, Codec, Effect, Context, Result]

Creates a remote API function call proxy.

Creates a remote API function call proxy.

Uses the remote function name and arguments to send an RPC request and extracts a result value or an error from the received RPC response.

Type parameters

Result

result type

Value parameters

function

remote function name

Attributes

Returns

specified remote function call proxy

Throws
RpcException

on RPC error

Inherited from:
ClientBase (hidden)

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Inherited fields

protected val logger: Logger

Attributes

Inherited from:
Logging (hidden)