Ask HN: Long-running polling jobs in FaaS?

4 points by miraculixx ↗ HN
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?

7 comments

[ 6.2 ms ] story [ 41.2 ms ] thread
Are you doing uptime checks?
No, 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.
You 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.
The 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.

Consider trying gcp cloud run. It enables to run a docker in serverless fashion. Or fargate in aws.
get 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.
Encountered similar constraints in our project, we moved from Lambda to running tasks in ECS.