Skip to content

Commit

Permalink
Move some TQ triggers under new namespace. (#1069)
Browse files Browse the repository at this point in the history
Move all task queue related API under newly formed `tasks` package. Task queue function are now under `tasks` namespace:

```
export const factorize = functions.tasks.taskQueue({
  rateLimits: {
    maxBurstSize: 2,
    maxConcurrentDispatches: 1,
    maxDispatchesPerSecond: 1,
  },
  retryConfig: {
    maxAttempts: 100,
    maxRetrySeconds: 1000,
    maxBackoffSeconds: 20,
    maxDoublings: 10,
    minBackoffSeconds: 0.1,
  }
}).onDispatch((data, context) => {
  deducePrivateKey(data.publicKey);
});
```

Same goes for handler namespace.

Few other changes:

1) Add probably-forgotten `maxRetrySeconds` option for task queues.
2) Remove `maxBurstsize` option since it's outputonly.
  • Loading branch information
taeold committed Apr 4, 2022
1 parent b9de399 commit c31cf60
Show file tree
Hide file tree
Showing 28 changed files with 1,353 additions and 1,101 deletions.
30 changes: 19 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"./lib/providers/pubsub": "./lib/providers/pubsub.js",
"./lib/providers/remoteConfig": "./lib/providers/remoteConfig.js",
"./lib/providers/storage": "./lib/providers/storage.js",
"./lib/providers/tasks": "./lib/providers/tasks.js",
"./lib/providers/testLab": "./lib/providers/testLab.js",
"./v1": "./lib/index.js",
"./v1/analytics": "./lib/providers/analytics.js",
Expand All @@ -58,6 +59,7 @@
"./v2/params": "./lib/v2/params/index.js",
"./v2/pubsub": "./lib/v2/providers/pubsub.js",
"./v2/storage": "./lib/v2/providers/storage.js",
"./v2/tasks": "./lib/v2/providers/tasks.js",
"./v2/alerts": "./lib/v2/providers/alerts/index.js",
"./v2/alerts/appDistribution": "./lib/v2/providers/alerts/appDistribution.js",
"./v2/alerts/billing": "./lib/v2/providers/alerts/billing.js",
Expand Down Expand Up @@ -98,12 +100,27 @@
"v1/storage": [
"lib/providers/storage"
],
"v1/tasks": [
"lib/providers/tasks"
],
"v1/testLab": [
"lib/providers/testLab"
],
"v2": [
"lib/v2"
],
"v2/alerts": [
"lib/v2/providers/alerts"
],
"v2/alerts/appDistribution": [
"lib/v2/providers/alerts/appDistribution"
],
"v2/alerts/billing": [
"lib/v2/providers/alerts/billing"
],
"v2/alerts/crashlytics": [
"lib/v2/providers/alerts/crashlytics"
],
"v2/base": [
"lib/v2/base"
],
Expand All @@ -122,17 +139,8 @@
"v2/storage": [
"lib/v2/providers/storage"
],
"v2/alerts": [
"lib/v2/providers/alerts"
],
"v2/alerts/appDistribution": [
"lib/v2/providers/alerts/appDistribution"
],
"v2/alerts/billing": [
"lib/v2/providers/alerts/billing"
],
"v2/alerts/crashlytics": [
"lib/v2/providers/alerts/crashlytics"
"v2/tasks": [
"lib/v2/providers/tasks"
]
}
},
Expand Down
Loading

0 comments on commit c31cf60

Please sign in to comment.