class Orocos::Async::Local::NameService

Public Class Methods

new(options = Hash.new) click to toggle source
Calls superclass method Orocos::Async::NameServiceBase.new
# File lib/orocos/async/name_service.rb, line 222
def initialize(options = Hash.new)
    options,other_options = Kernel.filter_options options,
        :tasks => Array.new

    name_service = Orocos::Local::NameService.new options[:tasks]
    super(name_service,other_options)
end

Public Instance Methods

get(name,options=Hash.new,&block) click to toggle source
# File lib/orocos/async/name_service.rb, line 230
def get(name,options=Hash.new,&block)
    async_options,other_options = Kernel.filter_options options,
        :sync_key => nil,
        :raise => nil,
        :event_loop => @event_loop,
        :period => nil,
        :wait => nil

    if block
        p = proc do |task,error|
            task = task.to_async(async_options) unless error
            if block.arity == 2
                block.call task,error
            elsif !error
                block.call task
            end
        end
        orig_get name,other_options,&p
    else
        task = orig_get name,other_options
        task.to_async(async_options)
    end
end