Skip to main content
Module

x/jok_transport/mod.ts>Transport

🦕🚌 Transport for your messages from Front-end to Back-end to Front-end to Anywhere
Go to Latest
interface Transport
import { type Transport } from "https://deno.land/x/jok_transport@v1.1.3/mod.ts";

Properties

readonly
state: TransportState
isConnected: Promise<boolean>

Methods

init(): Promise<void>

Make sure all entities are initialized

start(): Promise<void>

At this point all handlers are registered and we can configure Exchange->Queue bindings by calling start()

stop(): Promise<void>

Stop connection to the queues

on(
route: string,
options?: { readRawMessage?: boolean; },
): () => void

Subscribe to the specific route

off(route: string): void
publish(
route: string,
payload: unknown,
): Promise<void>

Publish event, no result will be returned

execute<TResult = unknown>(
route: string,
payload: unknown,
): Promise<TResult>

Execute RPC call, result will be returned always

throws RPCTimeout error

dispose(): Promise<void>

Make sure all resources are disposed Temp queues should be deleted