Sha256: a29f5d22485fbcf192fd39971f97b53db60c8b6f711bb7a6998cd33426fb2c48

Contents?: true

Size: 975 Bytes

Versions: 1

Compression:

Stored size: 975 Bytes

Contents

module Backport
  module Server
    class Base
      def started?
        @started ||= false
        @started
      end

      def stop
        stopping
        @started = false
      end

      # A callback triggered when a Machine starts running or the server is
      # added to a running machine. Subclasses should override this method to
      # provide their own functionality.
      #
      # @return [void]
      def starting; end

      # A callback triggered when the server is stopping. Subclasses should
      # override this method to provide their own functionality.
      #
      # @return [void]
      def stopping; end

      # A callback triggered from the main loop of a running Machine.
      # Subclasses should override this method to provide their own
      # functionality.
      #
      # @return [void]
      def tick; end

      def start
        starting
        @started = true
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
backport-0.2.0 lib/backport/server/base.rb