lib/ruby_skynet/server.rb in ruby_skynet-0.5.0 vs lib/ruby_skynet/server.rb in ruby_skynet-0.6.0

- old
+ new

@@ -1,6 +1,6 @@ -require 'bson' +require 'thread_safe' # # RubySkynet Server # # Hosts one or more Skynet Services @@ -204,16 +204,16 @@ end # Registers a Service Class as being available at this server def register_service(klass) logger.debug "Registering Service: #{klass.name} with name: #{klass.skynet_name}" - Registry.register_service(klass.skynet_name, klass.skynet_version || 1, klass.skynet_region, @hostname, @port) + ::RubySkynet.services.register_service(klass.skynet_name, klass.skynet_version || 1, klass.skynet_region, @hostname, @port) end # De-register service from this server def deregister_service(klass) logger.debug "De-registering Service: #{klass.name} with name: #{klass.skynet_name}" - Registry.deregister_service(klass.skynet_name, klass.skynet_version || 1, klass.skynet_region, @hostname, @port) + ::RubySkynet.services.deregister_service(klass.skynet_name, klass.skynet_version || 1, klass.skynet_region, @hostname, @port) end # Called for each message received from the client # Returns a Hash that is sent back to the caller def on_message(skynet_name, method, params)