Files
fn-serverless/images/sleeper/func.rb
Travis Reeder f559acd7ed Renamed a bunch of images to use fnproject org. (#239)
* Renamed a bunch of images to use fnproject org.

* Multi-stage build for Docker.

* Added tmp vendor dirs to gitignore.

* Run docker-build at beginning of test.
2017-08-23 22:43:53 +03:00

17 lines
371 B
Ruby

require 'json'
payload = STDIN.read
if payload != ""
payload = JSON.parse(payload)
# payload contains checks
if payload["sleep"]
i = payload['sleep'].to_i
STDERR.puts "Sleeping for #{i} seconds..."
sleep i
puts "I'm awake!" # sending this to stdout for sync response
end
else
puts "ERROR: please pass in a sleep value: {\"sleep\": 5}"
end