|
2 | 2 | import inspect |
3 | 3 | from collections import OrderedDict |
4 | 4 | from concurrent.futures import ThreadPoolExecutor |
5 | | -from typing import Any, AsyncGenerator, Callable, Optional, Set, TypeVar, get_type_hints |
| 5 | +from typing import Any, AsyncGenerator, Set, TypeVar, get_type_hints |
6 | 6 |
|
7 | 7 | from taskiq_dependencies import DependencyGraph |
8 | 8 |
|
@@ -88,22 +88,16 @@ class InMemoryBroker(AsyncBroker): |
88 | 88 | It's useful for local development, if you don't want to setup real broker. |
89 | 89 | """ |
90 | 90 |
|
91 | | - def __init__( # noqa: WPS211 |
| 91 | + def __init__( |
92 | 92 | self, |
93 | 93 | sync_tasks_pool_size: int = 4, |
94 | 94 | max_stored_results: int = 100, |
95 | 95 | cast_types: bool = True, |
96 | | - result_backend: Optional[AsyncResultBackend[Any]] = None, |
97 | | - task_id_generator: Optional[Callable[[], str]] = None, |
98 | 96 | max_async_tasks: int = 30, |
99 | 97 | ) -> None: |
100 | | - if result_backend is None: |
101 | | - result_backend = InmemoryResultBackend( |
102 | | - max_stored_results=max_stored_results, |
103 | | - ) |
104 | | - super().__init__( |
105 | | - result_backend=result_backend, |
106 | | - task_id_generator=task_id_generator, |
| 98 | + super().__init__() |
| 99 | + self.result_backend = InmemoryResultBackend( |
| 100 | + max_stored_results=max_stored_results, |
107 | 101 | ) |
108 | 102 | self.executor = ThreadPoolExecutor(sync_tasks_pool_size) |
109 | 103 | self.receiver = Receiver( |
|
0 commit comments