Commit Graph

1672 Commits

Author SHA1 Message Date
Roman Mogylatov
cd02128823 Make cosmetic fixes to FastAPI + Redis example 2021-01-03 22:20:27 -05:00
Roman Mogylatov
a782c6e1bc Add FastAPI + Redis example 2021-01-03 22:15:27 -05:00
Roman Mogylatov
dcea50b3a3 Fix Singleton and ThreadLocalSingleton to handle initialization errors 2021-01-03 18:07:37 -05:00
Roman Mogylatov
ea5af60669 Add test to cover resource initialization with an error 2021-01-03 17:51:59 -05:00
Roman Mogylatov
0aaae89328 Cover shutdown of not initialized resource 2021-01-03 17:38:20 -05:00
Roman Mogylatov
fe583ac9cf Fix typo in resource provider tests 2021-01-03 17:33:28 -05:00
Roman Mogylatov
bc07402b23 Add tests for async context kwargs injections 2021-01-03 17:28:48 -05:00
Roman Mogylatov
fe3ed6780a Improve resource typing stub 2021-01-03 17:17:49 -05:00
Roman Mogylatov
f1256a44fd Refactor provider typing stubs 2021-01-02 23:42:14 -05:00
Roman Mogylatov
cb2a36b216 Refactor Singleton typing stubs to return singleton from argument methods 2021-01-02 23:32:23 -05:00
Roman Mogylatov
644406b594 Add typing stubs for async_() method + tests 2021-01-02 23:29:17 -05:00
Roman Mogylatov
227d3494da Add Provider.async_() method + tests 2021-01-02 22:47:59 -05:00
Roman Mogylatov
141843e62f Refactor Resource provider to use async mode api 2021-01-01 22:50:27 -05:00
Roman Mogylatov
2c911ff1f2 Finish Singleton refactoring to use async mode api 2021-01-01 22:34:19 -05:00
Roman Mogylatov
3da1698f95 Refactor ThreadLocalSingleton provider to use async mode api 2021-01-01 22:31:48 -05:00
Roman Mogylatov
913b562369 Refactor ThreadSafeSingleton provider to use async mode api 2021-01-01 22:29:10 -05:00
Roman Mogylatov
cf69a63915 Refactor Singleton provider to use async mode api 2021-01-01 22:26:32 -05:00
Roman Mogylatov
e4fd36555f Add support of async mode for FactoryAggregate provider + tests 2020-12-30 22:40:31 -05:00
Roman Mogylatov
d5a8da8907 Add tests for Dependency provider async mode 2020-12-30 13:31:06 -05:00
Roman Mogylatov
c9242e51f6 Refactor Dependency provider to use async mode api 2020-12-30 13:31:06 -05:00
Roman Mogylatov
8bf641dd36 Refactor Provider.__call__() to use async mode api 2020-12-30 13:31:01 -05:00
Roman Mogylatov
eb6e19e60b Add tests for async mode auto configuration 2020-12-30 13:31:01 -05:00
Roman Mogylatov
0a30efec5a Add typing stubs & tests for async mode API 2020-12-30 13:31:01 -05:00
Roman Mogylatov
e09b93c21b Add async mode API + tests 2020-12-30 13:31:01 -05:00
Roman Mogylatov
fb296788e3 Refactor abstract* providers __call__() 2020-12-30 13:30:58 -05:00
Roman Mogylatov
a89602e690 Add typing stubs for async resource 2020-12-30 13:30:58 -05:00
Roman Mogylatov
541641d36c Add overload for Factory typing 2020-12-30 13:30:58 -05:00
Roman Mogylatov
b446dab559 Add async mode for the provider 2020-12-30 13:30:58 -05:00
Roman Mogylatov
32c4c6e29a Implement async mode for Dependency provider 2020-12-30 13:30:54 -05:00
Roman Mogylatov
0c42ff9242 Update .provided + fix resource concurent initialization issue 2020-12-30 13:30:51 -05:00
Roman Mogylatov
90a6cb3c6d Implement injections in thread-local and thread-safe singleton providers 2020-12-30 13:30:50 -05:00
Roman Mogylatov
6020c6caf4 Add singleton implementation + tests for all singleton types 2020-12-30 13:30:48 -05:00
Roman Mogylatov
f07f3e4943 Implement attribute injections and add tests 2020-12-30 13:30:46 -05:00
Roman Mogylatov
53a5d07b3a Implement positional injections, add tests and make refactoring 2020-12-30 13:30:46 -05:00
Roman Mogylatov
af51779477 Refactor kwargs injections 2020-12-30 13:30:46 -05:00
Roman Mogylatov
aaacc07916 Turm asyncio import to conditional for safer Py2 usage 2020-12-30 13:30:45 -05:00
Roman Mogylatov
0015e4e50a Fix isawaitable error 2020-12-30 13:30:45 -05:00
Roman Mogylatov
caee7f6b41 Add first dirty async injections implementation 2020-12-30 13:30:45 -05:00
Roman Mogylatov
c51eb52053 Fix init async resources in container on Python 2 2020-12-30 13:30:44 -05:00
Roman Mogylatov
86d2f655de Move container async resource tests to a separate module for Python 3.6+ 2020-12-30 13:30:44 -05:00
Roman Mogylatov
45cd887a37 Implement async resources initialization in container 2020-12-30 13:30:44 -05:00
Roman Mogylatov
8505440677 Refactor FastAPI tests 2020-12-30 13:30:44 -05:00
Roman Mogylatov
d23d506e1a Add awaits into async resource class test 2020-12-30 13:30:44 -05:00
Roman Mogylatov
3ab2b1f573 Rework async resources callbacks to .add_done_callback() style (fixes pypy3 issue) 2020-12-30 13:30:44 -05:00
Roman Mogylatov
31b03243a4 Add tests for async resources 2020-12-30 13:30:42 -05:00
Roman Mogylatov
dea1033371 Refactor provider tests 2020-12-30 13:30:41 -05:00
Roman Mogylatov
3f8af1cd56 Add tests for async injections in wiring @inject 2020-12-30 13:30:41 -05:00
Roman Mogylatov
c4825956f7 Fix tests 2020-12-30 13:30:41 -05:00
Roman Mogylatov
d50fbbd83b Add resource base class for async resources 2020-12-30 13:30:40 -05:00
Roman Mogylatov
fc2633faa3 Update resource provider typing stub for stutdown 2020-12-30 13:30:40 -05:00