4 ms·
Ask HN: Long-running polling jobs in FaaS?
Scenario: We need to deploy several long-running polling servers that poll some source (e.g. web page, database). Deployment should work very much like in FaaS such as projectfn, fission.
Problem: projectfn and fission both only support short-lived function calls, but no polling servers. This limits what you can do pretty much.
Alternatives might be dokku or using a straight forward k8s deployment descriptor.
Thoughts?
- verdverm 7y agoAre you doing uptime checks?
- miraculixx 7y agoNo, in general looking to deploy stateful long-running tasks. This was just an example. Can be any application that runs on a loop, i.e. not triggered but polling.
- giaour 7y agoYou can always write a function that gets triggered on a schedule and then performs a polling action. For example, instead on continuously polling, have a Lambda function that polls once and stops immediately if there's no work to be done yet, then use a CloudWatch Event to run that function once a minute.
- eternalban 7y agoThe conceptually consistent approach would note that a "long running polling job" is not a function. Architecturally this seems to necessitate a traditional non-FaaS foundation of some sort. A "long running job" (aka as a process in the entirely unhip ancient history of IT) can call from this foundation to "functions" that perform a poll on a resource. I look at your scenario's stated requirements and wonder how did an asset deployment requirement morph into a operational and computational model requirement.
- samblr 7y agoConsider trying gcp cloud run. It enables to run a docker in serverless fashion. Or fargate in aws.
- whb07 7y agoget a raspberry pi and run your script at home 24/7. As long as you have access to the internet this would be a neat little way to do it.
- potta_coffee 7y agoEncountered similar constraints in our project, we moved from Lambda to running tasks in ECS.