Refactor Singleton provider to use async mode api

This commit is contained in:
Roman Mogylatov 2021-01-01 22:26:32 -05:00
parent e4fd36555f
commit cf69a63915
2 changed files with 2275 additions and 2379 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2168,7 +2168,6 @@ cdef class BaseSingleton(Provider):
def _async_init_instance(self, future_result, result): def _async_init_instance(self, future_result, result):
instance = result.result() instance = result.result()
self.__storage = instance self.__storage = instance
self.__async = True
future_result.set_result(instance) future_result.set_result(instance)
@ -2236,11 +2235,6 @@ cdef class Singleton(BaseSingleton):
self.__storage = instance self.__storage = instance
if self.__async:
result = asyncio.Future()
result.set_result(self.__storage)
return result
return self.__storage return self.__storage