From 7b300ce1f962d3caefe75b3570ca260418175a43 Mon Sep 17 00:00:00 2001 From: Alex Ellis Date: Mon, 25 Sep 2017 09:15:45 +0100 Subject: [PATCH] Update chaining_functions.md --- guide/chaining_functions.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guide/chaining_functions.md b/guide/chaining_functions.md index 521ab774..1fb572e2 100644 --- a/guide/chaining_functions.md +++ b/guide/chaining_functions.md @@ -50,7 +50,7 @@ def handler(st): ### Function Director pattern -In the Function Director pattern - we create a "wrapper function" which pipes the result of function call A into function call B then returns the value to the caller. This saves on bandwidth and latency vs. client-side piping: +In the Function Director pattern - we create a "wrapper function" which can then either pipes the result of function call A into function call B or compose the results of A and B before returning a result. This approach saves on bandwidth and latency vs. client-side piping and means you can version both your connector and the functions involved. Take our previous example: @@ -71,3 +71,11 @@ def handler(req): print("Slack result: " + str(slack_result.status_code)) ``` + +Practical example: + +GitHub sends a "star" event to tweetfanclub function, tweetfanclub uses get-avatar to download the user's profile picture - stores that in an S3 bucket, then invokes tweetstargazer which tweets the image. A polaroid effect is added by a "polaroid" function. + +This example uses a mix of regular binaries such as ImageMagick and Python handlers generated with the FaaS-CLI. + +* [GitHub to Twitter Fanclub](https://github.com/alexellis/faas-twitter-fanclub/blob/master/README.md)