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

Use firebase-queue together with firebase cloud functions? #5

Open
ElectroBuddha opened this issue Aug 20, 2018 · 2 comments
Open

Use firebase-queue together with firebase cloud functions? #5

ElectroBuddha opened this issue Aug 20, 2018 · 2 comments
Labels

Comments

@ElectroBuddha
Copy link

Hi,
I've been using firebase-queue before firebase cloud functions were released. Since then I've moved to cloud functions, but I still think that queues were really great solution for chaining different kinds of tasks. On the other hand, cloud functions are great because now I can host all of my server-side logic on the firebase platform, whereas with firebase-queues I had to host server-side app on my own server.
Is it possible to have best of the both worlds, to use firebase-queues inside cloud-functions, maybe use cloud functions' 'onWrite' trigger to run the queue?

@EECOLOR
Copy link
Member

EECOLOR commented Aug 21, 2018

As you can see in FirebaseExtended#115 I'm open to the idea. The problem for me is my inexperience with Firebase Functions and mainly testing them.

I guess that the effort to create a queue worker to operate on the Firebase Functions API is very small. If we split the code at around queue_worker.js#L28 we are getting close.

A tricky thing is probably the busy part, I haven't read enough about functions to know their semantics. If we are guaranteed that the code will only be active during a single invocation (for example for an onWrite callback) we are good. If a function is re-used while it is processing things will become a bit more complicated in situations where the queue is filled faster than the processing speed of the functions.

So in short: I would love to add support for it but my knowledge is limited. So any help and information (especially with testing) would be awesome.

@LoveMHz

This comment has been minimized.

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

No branches or pull requests

3 participants