Send a message to manager using connection `c` and return response
(c, id, methodname, args=(), kwds={})
| 83 | # |
| 84 | |
| 85 | def dispatch(c, id, methodname, args=(), kwds={}): |
| 86 | ''' |
| 87 | Send a message to manager using connection `c` and return response |
| 88 | ''' |
| 89 | c.send((id, methodname, args, kwds)) |
| 90 | kind, result = c.recv() |
| 91 | if kind == '#RETURN': |
| 92 | return result |
| 93 | try: |
| 94 | raise convert_to_error(kind, result) |
| 95 | finally: |
| 96 | del result # break reference cycle |
| 97 | |
| 98 | def convert_to_error(kind, result): |
| 99 | if kind == '#ERROR': |
no test coverage detected