Skip to content

Instantly share code, notes, and snippets.

@ManickYoj
Last active April 5, 2022 01:06
Show Gist options
  • Save ManickYoj/cb68878a8533dd0755ed1f498abef558 to your computer and use it in GitHub Desktop.
Save ManickYoj/cb68878a8533dd0755ed1f498abef558 to your computer and use it in GitHub Desktop.
def operation(iteration)
# ... Implemented As above
end
# Only runs if the file is the entry point for execution,
# but not if loaded as a library
if $0 == __FILE__
puts "[INFO #{Time.now}] #--- Starting Worker Program ---#"
at_exit do
puts "[WARN #{Time.now}] #--- Received interrupt ---#"
# But now what?!
end
iteration = 0
# Main loop
while true
operation(iteration)
iteration += 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment