Skip to content

Instantly share code, notes, and snippets.

@paneq
Created September 18, 2018 15:16
Show Gist options
  • Save paneq/f5dcdec250764de0cab1af5d86812cf7 to your computer and use it in GitHub Desktop.
Save paneq/f5dcdec250764de0cab1af5d86812cf7 to your computer and use it in GitHub Desktop.
class MyCommandHandler
def initialize
make_threadsafe_by_stateless
end
def call(cmd)
local_var = cmd.something
output(local_var)
end
private
def make_threadsafe_by_stateless
freeze
end
def output(local_var)
puts(local_var)
end
end
CMD_HANDLER = MyCommandHandler.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment