Async.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: euc-jp -*-
3 
4 
20 
21 import threading
22 import OpenRTM_aist
23 
24 
26 
27  def __init__(self, obj, func, *args):
28  OpenRTM_aist.Task.__init__(self)
29  self._obj = obj
30  self._func = func
31  self._finished = False
32  self._args = args
33  self._mutex = threading.RLock()
34 
35  def invoke(self):
36  self.activate()
37 
38 
39  def finished(self):
40  guard = OpenRTM_aist.ScopedLock(self._mutex)
41  return self._finished
42 
43 
44  def svc(self):
45  if len(self._args) > 0:
46  self._func(self._obj, self._args)
47  else:
48  self._func(self._obj)
49 
50  guard = OpenRTM_aist.ScopedLock(self._mutex)
51  self._finished = True
52  return 0
53 
54 
56 
57  def __init__(self, obj, func, *args):
58  OpenRTM_aist.Task.__init__(self)
59  self._obj = obj
60  self._func = func
61  self._args = args
62  self._finished = False
63 
64 
65  def invoke(self):
66  self.activate()
67 
68 
69  def finished(self):
70  return self._finished
71 
72 
73  def svc(self):
74  if len(self._args) > 0:
75  self._func(self._obj, self._args)
76  else:
77  self._func(self._obj)
78 
79  self._finished = True
80  return 0
81 
82 
83 
165 def Async_tInvoker(obj, func, *args):
166  return Async_t(obj, func, *args)
167 
168 
169 def Async_ref_tInvoker(obj, func, *args):
170  return Async_ref_t(obj, func, *args)
def __init__(self, obj, func, args)
Definition: Async.py:27
def activate(self)
Definition: Task.py:48
def Async_ref_tInvoker(obj, func, args)
Definition: Async.py:169
def __init__(self, obj, func, args)
Definition: Async.py:57
def Async_tInvoker(obj, func, args)
def Async_tInvoker(func, auto_delete = False):
Definition: Async.py:165


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:34