-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for cloud tasks within the emulator. #7475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
690be0e
register cloud task triggers
GarrettBurroughs dfc96b0
Create and register task queue emulator
GarrettBurroughs 0bd36f5
Add basic features of task queue emulator
GarrettBurroughs 00cb33d
Implement a queue to improve performance of tasks emulator
GarrettBurroughs 6b35b80
Remove unused import
GarrettBurroughs 29b4a36
Register task queues from functions emulator
GarrettBurroughs 46bdc76
change task queue endpoint to accept IDs in body instead of query params
GarrettBurroughs 3fc9f1c
set enviornment variable when task queue emulator is running
GarrettBurroughs acd6c78
Remove bug where tasks were getting dispatched too fast
GarrettBurroughs e9c66a5
Merge remote-tracking branch 'origin' into gburroughs-taskqueue-emulator
GarrettBurroughs cee1b3d
Rework task enqueueing API and support task deletion
GarrettBurroughs db34cbd
properly support task deletion
GarrettBurroughs 1c6f599
Refactor Task Dispatching Algorithm
GarrettBurroughs 8957ee8
Add task deduplication for all tasks that have ever been added
GarrettBurroughs 84685f6
Refactor Task Queue
GarrettBurroughs ff45600
Add tests for task queue emulator
GarrettBurroughs af218d8
respond to PR review
GarrettBurroughs faae51e
update firebase-config.json
GarrettBurroughs 2c88c8e
use node-fetch
GarrettBurroughs d9126f1
fix tests
GarrettBurroughs 3203c1b
Make tasks emulator start up whenever functions emulator starts
GarrettBurroughs 7fcdd90
fix error message
GarrettBurroughs 967a9bc
Add statistics endpoint
GarrettBurroughs 03297d5
Add in global task deduplication
GarrettBurroughs fd97f9b
Add headers to request
GarrettBurroughs 8ed0482
Review Changes
GarrettBurroughs 0fe03f3
Remove console logs
GarrettBurroughs b9a0a63
Update backoff calculations
GarrettBurroughs b5813ae
Merge branch 'master' into gburroughs-taskqueue-emulator
GarrettBurroughs b978de0
Merge branch 'master' into gburroughs-taskqueue-emulator
blidd-google 7b1d6a3
Merge branch 'master' into gburroughs-taskqueue-emulator
joehan 2c4d236
add changelog
blidd-google File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: does this mean we always run the task emulator whenever we run the functions emulator?
I think this is fine for now, but I think an ideal solution would run the task emulator only if a task queue function is defined.
I don't know whether something like that is possible, but if you have time would love for you to see if that's even feasible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the task queue emulator is run whenever the functions emulator is run.
There is the code here:
firebase-tools/src/emulator/tasksEmulator.ts
Line 215 in 03297d5
which only starts the listening logic of the task queue emulator once an actual task has been enqueued to avoid doing unnecessary updates while the user isn't doing anything with task queues in their functions code. The express server is still spun up every time the functions emulator starts though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I wonder if we should instead have Task Queue Emulators be explicitly started, just like the Pub/sub emulator.
@blidd-google thoughts?