Sha256: 5229463718b96375c6df196f180bfdf03c9761af6f4807e4750f846a2f83baca

Contents?: true

Size: 898 Bytes

Versions: 1

Compression:

Stored size: 898 Bytes

Contents

namespace :ruby_skynet do

  desc "Start the Ruby Skynet Server.\n Rails Example: rake ruby_skynet:server\n Without Rails: SKYNET_ENV=production SKYNET_CONFIG=config/ruby_skynet rake ruby_skynet:server"
  task :server => :environment do
    # Configuration is automatically loaded when running under Rails
    # so skip it here under Rails
    unless defined?(Rails)
      # Environment to use in config file
      # Defaults to Rails.env
      environment = ENV['SKYNET_ENV']

      # Environment to use in config file
      # Defaults to config/ruby_skynet.yml
      cfg_file = ENV['SKYNET_CONFIG']

      # Load the configuration file
      RubySkynet.configure!(cfg_file, environment)
    end

    server = nil
    begin
      server = RubySkynet::Server.new
      server.register_services_in_path
      server.wait_until_server_stops
    ensure
      server.close if server
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_skynet-2.0.0.rc1 lib/ruby_skynet/railties/ruby_skynet.rake