Skip to main content
Module

x/ddapps/api.ts>Api

Deno distributed applications framework
Latest
class Api
import { Api } from "https://deno.land/x/ddapps@1.6.5/api.ts";

Methods

private
init(message: M<EMType.ClientRequest>): void

Api has a context and is in charge of starting a tracing

protected
invalid(message: M<EMType.ClientRequest>): void

Call this in you default switch case when the operation did not match It returns EMType.InvalidClientRequestType to the client & a log to the Logger

protected
[EMType.ClientConnectionClose](message: M<EMType.ClientConnectionClose>)

Removes the tokens related to the closed connection

protected
[EMType.ClientNotification](message: M<EMType.ClientNotification>)

Messages sent to clients watching values

protected
[EMType.ClientRequest](message: M<EMType.ClientRequest>)
protected
[EMType.ClientResponse](message: M<EMType.ClientResponse>)

Usually components should use Messenger.response() to not have to handle token But for async watchers, context is not sufficient to perform the matching Thus component may formulate complete ClientResponse and send them to Api