From 697d894df6e5fc54b7da73f7f1d85392cf0dd5a3 Mon Sep 17 00:00:00 2001 From: dillonstreator Date: Tue, 13 Feb 2024 14:51:23 -0600 Subject: [PATCH] fix readme --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b7a485..d486542 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,10 @@ const client = new Client({ }); await client.connect(); +const HTTP_PORT = process.env.PORT || 3000; + const processor = EventProcessor( - createProcessorClient(client), + createProcessorClient(client), { UserInvited: { sendEmail: async (event, { signal }) => { @@ -84,6 +86,9 @@ const processor = EventProcessor( // during graceful shutdown enabling the processor to // save handler result updates to the event ASAP }, + publish: async (event) => { + // publish to event bus + }, // other handler that should be executed when a `UserInvited` event is saved }, // other event types @@ -119,7 +124,7 @@ const server = http.createServer(async (req, res) => { } catch (error) { await client.query("ROLLBACK").catch(() => {}); } -}); +}).listen(HTTP_PORT, () => console.log(`listening on port ${HTTP_PORT}`)); gracefulShutdown(server, { onShutdown: async () => {