forked from hatchet-dev/hatchet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
31 changed files
with
1,706 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"setup": "Setup", | ||
"creating-a-worker": "Creating a Worker", | ||
"creating-a-workflow": "Creating a Workflow", | ||
"pushing-events": "Pushing Events", | ||
"scheduling-workflows": "Scheduling Workflows" | ||
} | ||
"setup": "Setup", | ||
"creating-a-workflow": "Creating a Workflow", | ||
"creating-a-worker": "Creating a Worker", | ||
"pushing-events": "Pushing Events", | ||
"scheduling-workflows": "Scheduling Workflows" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"setup": "Setup", | ||
"creating-a-worker": "Creating a Worker", | ||
"creating-a-workflow": "Creating a Workflow", | ||
"pushing-events": "Pushing Events" | ||
} | ||
"setup": "Setup", | ||
"creating-a-workflow": "Creating a Workflow", | ||
"creating-a-worker": "Creating a Worker", | ||
"pushing-events": "Pushing Events" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"setup": "Setup", | ||
"creating-a-worker": "Creating a Worker", | ||
"creating-a-workflow": "Creating a Workflow", | ||
"pushing-events": "Pushing Events" | ||
} | ||
"setup": "Setup", | ||
"creating-a-workflow": "Creating a Workflow", | ||
"creating-a-worker": "Creating a Worker", | ||
"pushing-events": "Pushing Events" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Hatchet from '../../src/sdk'; | ||
|
||
const hatchet = Hatchet.init(); | ||
|
||
const sleep = (ms: number) => | ||
new Promise((resolve) => { | ||
setTimeout(resolve, ms); | ||
}); | ||
|
||
async function main() { | ||
hatchet.event.push('concurrency:create', { | ||
data: 'event 1', | ||
userId: 'user1', | ||
}); | ||
|
||
// step 1 will wait 5000 ms, | ||
// so sending a second event | ||
// before that will cancel | ||
// the first run and run the second event | ||
await sleep(1000); | ||
|
||
hatchet.event.push('concurrency:create', { | ||
data: 'event 2', | ||
userId: 'user1', | ||
}); | ||
} | ||
|
||
main(); |
Oops, something went wrong.