Lifecycle of a google cloud firebase background function?
up vote
0
down vote
favorite
I've been using the GCP Firebase Functions for about a week now for work.
My question is regarding the lifecycle(dunno if that's the right term) of Background functions.
Say for example I get a CSV file from a bucket
const file = bucket('foo').file('some/file.csv');
after which I download the file and then parse the CSV with some function, and then I send it to firestore.
file.download()
.then(data => parseCSV(data[0]))
.then(parsedData => sendToFirestore())
.catch(error => {
// handle...
})
In an HTTPS function, all I would have do to end the function would be to call res.end()
or something similar.
But how does a background function register that it should stop running or that it's done?
javascript firebase google-cloud-platform google-cloud-functions
add a comment |
up vote
0
down vote
favorite
I've been using the GCP Firebase Functions for about a week now for work.
My question is regarding the lifecycle(dunno if that's the right term) of Background functions.
Say for example I get a CSV file from a bucket
const file = bucket('foo').file('some/file.csv');
after which I download the file and then parse the CSV with some function, and then I send it to firestore.
file.download()
.then(data => parseCSV(data[0]))
.then(parsedData => sendToFirestore())
.catch(error => {
// handle...
})
In an HTTPS function, all I would have do to end the function would be to call res.end()
or something similar.
But how does a background function register that it should stop running or that it's done?
javascript firebase google-cloud-platform google-cloud-functions
2
I would suggest you watch the videos from the official series: firebase.google.com/docs/functions/video-series, in particular the ones titled "Learn JavaScript Promises".
– Renaud Tarnec
Nov 22 at 15:59
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've been using the GCP Firebase Functions for about a week now for work.
My question is regarding the lifecycle(dunno if that's the right term) of Background functions.
Say for example I get a CSV file from a bucket
const file = bucket('foo').file('some/file.csv');
after which I download the file and then parse the CSV with some function, and then I send it to firestore.
file.download()
.then(data => parseCSV(data[0]))
.then(parsedData => sendToFirestore())
.catch(error => {
// handle...
})
In an HTTPS function, all I would have do to end the function would be to call res.end()
or something similar.
But how does a background function register that it should stop running or that it's done?
javascript firebase google-cloud-platform google-cloud-functions
I've been using the GCP Firebase Functions for about a week now for work.
My question is regarding the lifecycle(dunno if that's the right term) of Background functions.
Say for example I get a CSV file from a bucket
const file = bucket('foo').file('some/file.csv');
after which I download the file and then parse the CSV with some function, and then I send it to firestore.
file.download()
.then(data => parseCSV(data[0]))
.then(parsedData => sendToFirestore())
.catch(error => {
// handle...
})
In an HTTPS function, all I would have do to end the function would be to call res.end()
or something similar.
But how does a background function register that it should stop running or that it's done?
javascript firebase google-cloud-platform google-cloud-functions
javascript firebase google-cloud-platform google-cloud-functions
asked Nov 22 at 15:56
Charise
1
1
2
I would suggest you watch the videos from the official series: firebase.google.com/docs/functions/video-series, in particular the ones titled "Learn JavaScript Promises".
– Renaud Tarnec
Nov 22 at 15:59
add a comment |
2
I would suggest you watch the videos from the official series: firebase.google.com/docs/functions/video-series, in particular the ones titled "Learn JavaScript Promises".
– Renaud Tarnec
Nov 22 at 15:59
2
2
I would suggest you watch the videos from the official series: firebase.google.com/docs/functions/video-series, in particular the ones titled "Learn JavaScript Promises".
– Renaud Tarnec
Nov 22 at 15:59
I would suggest you watch the videos from the official series: firebase.google.com/docs/functions/video-series, in particular the ones titled "Learn JavaScript Promises".
– Renaud Tarnec
Nov 22 at 15:59
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434553%2flifecycle-of-a-google-cloud-firebase-background-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
I would suggest you watch the videos from the official series: firebase.google.com/docs/functions/video-series, in particular the ones titled "Learn JavaScript Promises".
– Renaud Tarnec
Nov 22 at 15:59