Class: Orocos::Async::Local::NameService
- Inherits:
-
NameServiceBase
- Object
- ObjectBase
- NameServiceBase
- Orocos::Async::Local::NameService
- Extended by:
- Utilrb::EventLoop::Forwardable
- Defined in:
- lib/orocos/async/name_service.rb
Constant Summary
Constants included from Namespace
Instance Attribute Summary
Attributes inherited from NameServiceBase
Attributes included from ObjectBase::Periodic::ClassMethods
Attributes inherited from ObjectBase
#emitting, #event_loop, #name, #options, #pending_adds
Instance Method Summary collapse
- #get(name, options = Hash.new, &block) ⇒ Object
-
#initialize(options = Hash.new) ⇒ NameService
constructor
A new instance of NameService.
Methods inherited from NameServiceBase
#on_task_added, #proxy, #really_add_listener, #remove_listener
Methods included from Namespace
#basename, #map_to_namespace, #namespace, #namespace=, #same_namespace?, #split_name, split_name, validate_namespace_name, #verify_same_namespace
Methods included from ObjectBase::Periodic
#default_period, #period, #period=
Methods inherited from ObjectBase
#add_listener, define_event, define_events, #disable_emitting, #event, event_names, #event_names, #invalidate_delegator!, #listener?, #listeners, #number_of_listeners, #on_event, #proxy_event, #reachable!, #reachable?, #really_add_listener, #remove_all_listeners, #remove_listener, #remove_proxy_event, #unreachable!, #valid_delegator?, valid_event?, #valid_event?, validate_event, #validate_event, #wait
Constructor Details
#initialize(options = Hash.new) ⇒ NameService
Returns a new instance of NameService
222 223 224 225 226 227 228 |
# File 'lib/orocos/async/name_service.rb', line 222 def initialize( = Hash.new) , = Kernel. , :tasks => Array.new name_service = Orocos::Local::NameService.new [:tasks] super(name_service,) end |
Instance Method Details
#get(name, options = Hash.new, &block) ⇒ Object
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/orocos/async/name_service.rb', line 230 def get(name,=Hash.new,&block) , = Kernel. , :sync_key => nil, :raise => nil, :event_loop => @event_loop, :period => nil, :wait => nil if block p = proc do |task,error| task = task.to_async() unless error if block.arity == 2 block.call task,error elsif !error block.call task end end orig_get name,,&p else task = orig_get name, task.to_async() end end |