(name, key=key)
| 834 | if hasattr(method, MAGIC_ATTR): |
| 835 | |
| 836 | def generate_function(name, key=key): |
| 837 | def func(self, *args, **kwargs): |
| 838 | # dispatch to the actual worker |
| 839 | return getattr(self.worker_dict[key], name)(*args, **kwargs) |
| 840 | |
| 841 | async def async_func(self, *args, **kwargs): |
| 842 | # dispatch to the actual worker |
| 843 | return await getattr(self.worker_dict[key], name)(*args, **kwargs) |
| 844 | |
| 845 | wrapper = async_func if inspect.iscoroutinefunction(method) else func # noqa: B023 |
| 846 | |
| 847 | return wrapper |
| 848 | |
| 849 | func = generate_function(method_name) |
| 850 | # pass MAGIC_ATTR for outer worker group |
no outgoing calls
no test coverage detected