apache / apache/openwhisk

WebAction async

Open
#3,558 11 comments 4 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
6.8k
Forks
1.2k
Avg merge
2d 14h
Merged PRs (30d)
2

Description

So far in multiple occasions have talk to customers/users using OpenWhisk that they have a need to call a Web Action but want the Action to return right away but continue to do business logic.

One tangible use case is Web Analytics:
Web sites will call a web url on APIGateway, they would get back 202 response right away with the activation id of the web action.
The action will process the http request, taking more time (i.e. 1 second). The web site doesn't have to wait 1 second for it.

The current way of achieving is not optimal and I see a lot of folks copy pasting the same solution.
Were the web action will invoke another action that does the real work in async for example using the npm package "openwhisk" and then returning 202 with the activation id back to web client.
For every call it would generate 2 action invocations and user might reach concurrent or minuteRate limits, in addition creating activation records for web actions that don't do much just schedule an action is wasteful.

The proposal is to have a url for the web action that the controller will return right away with 202 and the activation id back to web client, and schedule the web action to run async.
Web Action url sync => `https://${APIHOST}/api/v1/web/guest/demo/hello`
Web Trigger url async => `https://${APIHOST}/api/v1/web-async/guest/demo/hello`

This might sound like a Web Hook, but I think Web Hook have a bit more complexity and a Web Hook I would say is an implementation using the Web Action sync url.
Ref: https://webhooks.pbworks.com/w/page/13385124/FrontPage

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.