Wednesday, July 15, 2026 3:55:40 AM
> project show esm_bot
A sophisticated Discord bot that bridges Arma 3 Exile servers with Discord communities. Built in Ruby with secure TCP communication, it delivers territory management, real-time notifications, and comprehensive server administration right in your Discord channels.
Details
> timer_task.rb
# frozen_string_literal: true

#
# A Concurrent::TimerTask whose work can't silently vanish.
#
# Concurrent::TimerTask only ever surfaces a StandardError: its internal SafeTaskExecutor rescues
# StandardError, so anything outside that tree (SystemStackError, NoMemoryError, ...) escapes before
# the observer notification runs and the executor pool drops it without a trace.
#
module ESM
  class TimerTask
    #
    # Builds and immediately starts the timer, mirroring Concurrent::TimerTask.execute.
    #
    # @param options [Hash] forwarded to Concurrent::TimerTask (e.g. +execution_interval:+, +run_now:+)
    #
    # @yield the work to run each interval; any raised error is logged and swallowed, never propagated
    #
    # @return [Concurrent::TimerTask]
    #
    def self.execute(**options, &task)
      Concurrent::TimerTask.execute(**options) do
        task.call
      rescue ::Exception => e # standard:disable Lint/RescueException
        ESM.logger.error!(error: e)
      end
    end
  end
end
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 43aa0d7