πͺExternal Events
Introduction
Hooks to an external event
publish/subscribe to events
import { connect, JSONCodec } from "nats";
(async () => {
const nc = await connect({ servers: "localhost:4222" });
const c = JSONCodec();
const sub = nc.subscribe("externals-events.ipfs_added_file");
(async () => {
for await (const m of sub) {
console.log(`[${sub.getProcessed()}]`, c.decode(m.data));
}
console.log("subscription closed");
})();
})();request/reply events
Example:
External events list
event
type
payload
notes
Example
Example
Last updated