Skip to content
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

Firebase-queue for Cloud Functions #115

Open
jaufgang opened this issue Mar 13, 2017 · 6 comments
Open

Firebase-queue for Cloud Functions #115

jaufgang opened this issue Mar 13, 2017 · 6 comments

Comments

@jaufgang
Copy link

jaufgang commented Mar 13, 2017

I am basing this issue on a question I came across on StackOverflow regarding whether or not cloud functions render firebase-queue obsolete, and my answer to that question. Also, I noticed that the Readme.md of this project has been changed to point developers away from this library in favour of cloud functions.

Firebase-queue provides much more than a way for tasks to listen to firebase and launch tasks. It provides a protocol for communication between parties assigning and and responding to task requests, coordinating retries of failed tasks, reporting progress, state and additional metadata, and task chaining.

I think it would be useful for Firebase to develop a firebase-functions-queue package that extends the firebase-functions package and allows you to write a firebase cloud function with the same signature as firebase-queue. Something like this:

const functions = require('firebase-functions');
const functions-queue = require('firebase-functions-queue'); //extends firebase-functions with onQueue function

admin.initializeApp(functions.config().firebase);

functions.database.ref('/queue').onQueue(options,function(data,progress,resolve,reject){
    ...
    })

This new package would work just like firebase-queue and use the same metadata and options, except it wouldn't need to deal with managing multiple worker processes since cloud functions already do this automatically and seamlessly.

This would have the following advantages:

  • Would allow firebase developers to use a standard way of assigning jobs to queues, monitor progress, failure, etc.
  • An app could assign a job to a queue and not care if it was being handled by a cloud function or a different environment.
  • A developer could take an existing queue and move it from their node server to cloud functions without changing the client app.
  • It could even allow task chaining where one task could be handled by a cloud function and another by a different server within the same job.
@katowulf
Copy link

@drtriumph @nicolasgarnier fyi

@chalber
Copy link

chalber commented Mar 16, 2017

another advantage is having a queue running on a local server that uses platform specific libraries that aren't supported on Cloud Functions

@prescottprue
Copy link

I agree with this. Have ended up just doing my own implementation instead of using queue

@alexanvl
Copy link

alexanvl commented Apr 9, 2017

This is interesting to me. I've done a few projects with firebase now and really like firebase-queue. I recently learned about functions and am curious how I can use it similarly and in combination with pub/sub to eliminate a dependency on amqp.

@incognitojam
Copy link

I am also interested in something like this and am sad to have not heard anything from the developers of this repository. firebase-queue offers a lot more than firebase functions and being able to deploy them to Firebase would be great.

@EECOLOR
Copy link

EECOLOR commented Jul 29, 2018

@jaufgang I just released a trimmed down version of firebase queue: https://github.com/kaliberjs/firebase-queue

It is a lot more lightweight, has less moving parts, no dependencies and a more modern approach (promises).

I am not sure what would be needed to support Firebase Functions, but if you look at the code you will see that it is probably pretty doable. I personally have no experience with Firebase Functions, but I think if there is enough demand and interest we can pull something off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants