Skip to content

Commit

Permalink
fix: sync listener
Browse files Browse the repository at this point in the history
  • Loading branch information
grutt committed Mar 26, 2024
1 parent a9fb2db commit 6c36142
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions examples/manual-trigger.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import Hatchet from '../src/sdk';
import { HatchetClient } from '../src/clients/hatchet-client/hatchet-client';
import { StepRunEvent } from '../src/clients/listener/listener-client';

const hatchet: HatchetClient = Hatchet.init();
const hatchet = Hatchet.init();

async function main() {
const workflowRunId = await hatchet.admin.run_workflow('example', {});

hatchet.listener.on(workflowRunId, async (event: StepRunEvent) => {
console.log('Received event', event);
});
for await (const event of hatchet.listener.stream(workflowRunId)) {
console.log('event received', event);
}
}

main();

0 comments on commit 6c36142

Please sign in to comment.