Sha256: 1d8e2ebbbc54f04e25200302165469789e5ed7bad2930608a4972a31ca2bedfe

Contents?: true

Size: 1.28 KB

Versions: 24

Compression:

Stored size: 1.28 KB

Contents

module Skynet::ConsoleHelper
# All of these commands can be run at the 'skynet console'.

    def log
      Skynet::Logger.get
    end

    def mq
      @mq ||= Skynet::MessageQueue.new
    end                       

    def stats
      mq.stats
    end

    def increment_worker_version
      mq.increment_worker_version
    end

    def get_worker_version
      mq.get_worker_version
    end

    def set_worker_version(*args)
      mq.set_worker_version(*args)
    end

    def manager
      @manager ||= Skynet::Manager.get
    end

    def add_lib(lib)
      manager.required_libs << File.expand_path(lib)
      manager.restart_workers
    end                      

    def restart_workers
      manager.restart_workers
    end

    def add_workers(num)
      manager.add_workers(num)
    end

    def remove_workers(num)
      manager.remove_workers(num)
    end

    # ===============
    # = Doesnt work =
    # ===============
    # def help
    #   puts <<-HELP
    #    mq
    #    stats
    #    increment_worker_version
    #    get_worker_version
    #    set_worker_version(version)
    #    manager
    #    add_lib(library_to_include)  -- forces a restart
    #    restart_workers
    #    add_workers(number_of_workers)
    #    remove_workers(number_of_workers)
    #   HELP
    # end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
brendan-skynet-0.9.3.1 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.3.2 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.3.3 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.3.5 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.3.6 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.3.7 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.3.8 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.303 lib/skynet/console_helper.rb
brendan-skynet-0.9.304 lib/skynet/console_helper.rb
brendan-skynet-0.9.305 lib/skynet/console_helper.rb
brendan-skynet-0.9.31 lib/skynet/skynet_console_helper.rb
brendan-skynet-0.9.310 lib/skynet/console_helper.rb
brendan-skynet-0.9.311 lib/skynet/console_helper.rb
brendan-skynet-0.9.312 lib/skynet/console_helper.rb
brendan-skynet-0.9.313 lib/skynet/console_helper.rb
brendan-skynet-0.9.314 lib/skynet/console_helper.rb
brendan-skynet-0.9.315 lib/skynet/console_helper.rb
brendan-skynet-0.9.316 lib/skynet/console_helper.rb
brendan-skynet-0.9.317 lib/skynet/console_helper.rb
brendan-skynet-0.9.318 lib/skynet/console_helper.rb