{"id":13799122,"url":"https://github.com/sbarbat/firestore-queuer","last_synced_at":"2025-10-29T16:13:02.658Z","repository":{"id":95742347,"uuid":"287066024","full_name":"sbarbat/firestore-queuer","owner":"sbarbat","description":"Firebase Firestore Queue System","archived":false,"fork":false,"pushed_at":"2020-08-17T08:32:50.000Z","size":36,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T05:02:36.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbarbat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-12T16:45:17.000Z","updated_at":"2024-04-07T11:15:49.000Z","dependencies_parsed_at":"2023-05-06T08:47:17.598Z","dependency_job_id":null,"html_url":"https://github.com/sbarbat/firestore-queuer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbat%2Ffirestore-queuer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbat%2Ffirestore-queuer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbat%2Ffirestore-queuer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbat%2Ffirestore-queuer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbarbat","download_url":"https://codeload.github.com/sbarbat/firestore-queuer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238480649,"owners_count":19479525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:00:59.091Z","updated_at":"2025-10-20T04:44:39.681Z","avatar_url":"https://github.com/sbarbat.png","language":"TypeScript","funding_links":[],"categories":["서버 사이드 (Cloud Functions, BigQuery 등)"],"sub_categories":["iOS"],"readme":"# Firebase Firestore Queue System\n  \nThis is a queue system that uses Firebase Firestore to store the messages and Firebase Cloud Functions. Using Firestore\nwe make sure our queue system is performant, scalable and easy to maintain.\n\nThe worker that process each message in the queue uses Firestore `stream()` method to fetch the messages from the queue\ncollection so it can process a lot of data without overloading the database.\n\n\u003e NOTE: This still on alpha version and haven't been tested in production yet. Use it under you own risk. **Feel free to contribute :)**\n\n## Configuration\n\n### Worker\n\nThe worker by default is configured to check if there are any new messages to process every 1 minute, but this can\nbe changed on the [index](functions/src/index.ts) file.\n\n### Processors\n\nThe processors are the functions that are going to be used to process a message stored on the queue. They\nmust be defined on the [queue-processors](functions/src/queue-processors.ts) file and each needs to implement\nthe following interface:\n\n```typescript\n/**\n * Message processor interface.\n *\n * All the processors must implement this interface.\n */\nexport interface MessageProcessor {\n    (data: Message): Promise\u003cMessage\u003e;\n}\n```\n\nEach processor needs to return a promise. If the promise fails, the worker will try to reprocess the file \nthe amount of times specified on the message in the `retry` field or use the default (5 retries). If the\npromise was resolved, the message will be removed from the queue since it's been processed.\n\nThere is processor example that will log the processor function and arguments in the \n[queue-processors](functions/src/queue-processors.ts) file:\n\n```typescript\n/**\n * Simple log processor\n *\n * @param msg message\n */\nexport const log: MessageProcessor = (msg: Message): Promise\u003cMessage\u003e =\u003e {\n    console.log(msg.processor.toString(), msg.arguments.toString());\n\n    return Promise.resolve(msg);\n}\n\n```\n\n## Deployment\n\n- [Make sure to have installed and configured the Firebase CLI for your project.](https://firebase.google.com/docs/cli#sign-in-test-cli)\n- Replace the `your-firebase-project-id-here` with your Firebase project id in the [.firebaserc](.firebaserc) file.\n- Run the `firebase deploy` command.\n\n## Queue a message\n\nA HTTP `queue` function is exposed to send messages to the queue. By default only logged users in can send messages\nto the queue but this can be changed on the [index](functions/src/index.ts) file.\n\nCheck the offical firebase documenation for more ways of calling the function to queue a message: \n[Call functions via HTTP requests](https://firebase.google.com/docs/functions/http-events)\n\nThe `queue` function can have the following parameters:\n- processor: The name of the function to use to process the message, for our example `log`\n- arguments: Any argument we want to send to the processor function. Default: null\n- retry: The number of times to attempt to process the message if it fails. Default: 5\n- delay: Delay to process the message from when its added to the queue. Defalt: 0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbarbat%2Ffirestore-queuer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbarbat%2Ffirestore-queuer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbarbat%2Ffirestore-queuer/lists"}