Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
interface Service
implements ServiceGroup
import { type Service } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";

Properties

stopped: Promise<null | Error>

A promise that gets resolved to null or Error once the service ends. If an error, then service exited because of an error.

isStopped: boolean

True if the service is stopped

Methods

stats(): Promise<ServiceStats>

Returns the stats for the service.

info(): ServiceInfo

Returns a service info for the service

Returns the identity used by this service

reset(): void

Resets all the stats

stop(err?: Error): Promise<null | Error>

Stop the service returning a promise once the service completes. If the service was stopped due to an error, that promise resolves to the specified error