Last active
April 5, 2022 00:59
-
-
Save ManickYoj/7e7940cf401c7839dd43870dd0d32a4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ---#" | |
iteration = 0 | |
# Main loop | |
begin | |
while true | |
operation(iteration) | |
iteration += 1 | |
end | |
rescue SignalException => e | |
puts "[WARN #{Time.now}] #--- Received interrupt ---#" | |
# But now what?! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment