module Orchestrator::Service::Mixin
Public Instance Methods
config(options)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 35 def config(options) @__config__.thread.schedule do @__config__.processor.config = options end end
defaults(options)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 41 def defaults(options) @__config__.thread.schedule do @__config__.processor.send_options(options) end end
delete(path, options = {}, &blk)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 31 def delete(path, options = {}, &blk) request(:delete, path, options, &blk) end
get(path, options = {}, &blk)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 19 def get(path, options = {}, &blk) request(:get, path, options, &blk) end
post(path, options = {}, &blk)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 23 def post(path, options = {}, &blk) request(:post, path, options, &blk) end
put(path, options = {}, &blk)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 27 def put(path, options = {}, &blk) request(:put, path, options, &blk) end
request(method, path, options = {}, &blk)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 6 def request(method, path, options = {}, &blk) defer = @__config__.thread.defer options[:method] = method options[:path] = path options[:defer] = defer options[:max_waits] = 0 # HTTP will only ever respond to a request options[:on_receive] = blk if blk # on command success @__config__.thread.schedule do @__config__.processor.queue_command(options) end defer.promise end
use_middleware(klass)
click to toggle source
# File lib/orchestrator/service/mixin.rb, line 51 def use_middleware(klass) # TODO:: end