mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Examples changes (#201)
This commit is contained in:
14
examples/sleeper/function.rb
Normal file
14
examples/sleeper/function.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
require 'json'
|
||||
|
||||
payload = STDIN.read
|
||||
if payload != ""
|
||||
payload = JSON.parse(payload)
|
||||
|
||||
# payload contains checks
|
||||
if payload["sleep"]
|
||||
i = payload['sleep'].to_i
|
||||
puts "Sleeping for #{i} seconds..."
|
||||
sleep i
|
||||
puts "I'm awake!"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user