Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
188 views
in Technique[技术] by (71.8m points)

Background processing with Firebase Cloud Functions

I recently started seemingly similar topic here, but I feel that maybe I implied too much in my question by asking how to implement something instead of asking how to solve specific problem. So here I go asking from different angle:

  • third-party API (most possibly webhook) sends .csv file and .docx files (data and template) and sends response as fast as those files are uploaded (no waiting until those documents are processed)
  • server merges that data and whenever the data is ready it sends to the user-specified endpoint response with download link
  • I want to use Firebase products to achieve that
  • it has to be compatible with typical automation tools like Zapier, Pabbly etc. (it just has to work like typical webhook)

In my previous question I got quite interesting answer to use PubSub (almost tried it, but got error while installing it), but I'm thinking - maybe there is some easier way to solve this?

question from:https://stackoverflow.com/questions/65847025/background-processing-with-firebase-cloud-functions

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Like I wrote in my last comment to your other question, if you plan to send heavy files to Cloud Functions, bear in mind that the size limit for data sent to an HTTP Cloud Functions is 10MB (See doc). There is the same limit for the size of messages you can push to Pub/Sub. (See doc).

One approach would be to upload the files (data and template) to Cloud Storage and pass their references to the HTTP Cloud Function and, from this one, pass them in the payload of the Pub/Sub message (as explained in the other answer). Then in the Pub/Sub Cloud Function, you read the files from Cloud Storage.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...