Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonstreator committed Feb 13, 2024
1 parent 6d49a46 commit 697d894
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ const client = new Client({
});
await client.connect();

const HTTP_PORT = process.env.PORT || 3000;

const processor = EventProcessor(
createProcessorClient<EevntType>(client),
createProcessorClient<EventType>(client),
{
UserInvited: {
sendEmail: async (event, { signal }) => {
Expand All @@ -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
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 697d894

Please sign in to comment.