class JsonRpc::DelayedResponse

Overview

Like Response, but delayed in that you can send a response to a request some time after your Handler#handle_rpc_call has returned.

See Request#respond_later

Defined in:

json_rpc/delayed_response.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(id : Int64 | String | Nil, client : JsonRpc::Client) #

[View source]

Instance Method Detail

def client : Client #

The underlying client


[View source]
def error(code : Int32, message : String, data : JSON::Any | Nil = nil) #

Sends an error response.


[View source]
def id : IdType #

The invocation id to respond to


[View source]
def respond(failure : LocalCallError) #

Sends an error response.


[View source]
def respond(result) #

Sends a successful response based on result.


[View source]
def send(response : Response) #

Sends a response to the backing #client.


[View source]