engin 0.1.0b3__py3-none-any.whl → 0.1.0b4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
engin/_engin.py CHANGED
@@ -188,13 +188,25 @@ class Engin:
188
188
  started to return so it is safe to use immediately after.
189
189
  """
190
190
  self._async_context_run_task = asyncio.create_task(self.run())
191
+ wait_tasks = [
192
+ asyncio.create_task(self._start_complete_event.wait()),
193
+ asyncio.create_task(self._stop_complete_event.wait()),
194
+ ]
191
195
  await asyncio.wait(
192
196
  [
193
- asyncio.create_task(self._start_complete_event.wait()),
194
- asyncio.create_task(self._stop_complete_event.wait()),
197
+ self._async_context_run_task, # if a provider errors this will return first
198
+ *wait_tasks,
195
199
  ],
196
200
  return_when=asyncio.FIRST_COMPLETED,
197
201
  )
202
+ for task in wait_tasks:
203
+ task.cancel()
204
+
205
+ # raise the exception from the startup during run
206
+ if self._async_context_run_task.done():
207
+ startup_exception = self._async_context_run_task.exception()
208
+ if startup_exception is not None:
209
+ raise startup_exception
198
210
 
199
211
  async def stop(self) -> None:
200
212
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: engin
3
- Version: 0.1.0b3
3
+ Version: 0.1.0b4
4
4
  Summary: An async-first modular application framework
5
5
  Project-URL: Homepage, https://github.com/invokermain/engin
6
6
  Project-URL: Documentation, https://engin.readthedocs.io/en/latest/
@@ -2,7 +2,7 @@ engin/__init__.py,sha256=O0vS570kZFBq7Kwy4FgeJFIhfo4aIg5mv_Z_9vAQRio,577
2
2
  engin/_assembler.py,sha256=MC14BRsgabGlq9weyv2VXylH4RE282uNTyNH5rN8Lqc,11359
3
3
  engin/_block.py,sha256=IacP4PoJKRhSQCbQSdoyCtmu362a4vj6qoUQKyaJwzI,3062
4
4
  engin/_dependency.py,sha256=xINk3sudxzsTmkUkNAKQwzBc0G0DfhpnrZli4z3ALBY,9459
5
- engin/_engin.py,sha256=-zJ3v7T_iRz8sWfQeRSNSrEOEfqUB5eoOGgmFpwIfvQ,8872
5
+ engin/_engin.py,sha256=GASnv9x0Qrrok_4zGbaFm7wWZqYNAZ55w0vU3Z-gn8g,9343
6
6
  engin/_graph.py,sha256=y1g7Lm_Zy5GPEgRsggCKV5DDaDzcwUl8v3IZCK8jyGI,1631
7
7
  engin/_introspect.py,sha256=VdREX6Lhhga5SnEP9G7mjHkgJR4mpqk_SMnmL2zTcqY,966
8
8
  engin/_lifecycle.py,sha256=cSWe3euZkmpxmUPFvph2lsTtvuZbxttEfBL-RnOI7lo,5325
@@ -19,8 +19,8 @@ engin/_cli/_inspect.py,sha256=0jm25d4wcbXVNJkyaeECSKY-irsxd-EIYBH1GDW_Yjc,3163
19
19
  engin/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  engin/extensions/asgi.py,sha256=d5Z6gtMVWDZdAlvrTaMt987sKyiq__A0X4gJQ7IETmA,3247
21
21
  engin/extensions/fastapi.py,sha256=7N6i-eZUEZRPo7kcvjS7kbRSY5QAPyKJXSeongSQ-OA,6371
22
- engin-0.1.0b3.dist-info/METADATA,sha256=LiWfvvBrd60nnSxNlrSCzBhUjQeLr2rn-m6ZwLsavFM,3201
23
- engin-0.1.0b3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
- engin-0.1.0b3.dist-info/entry_points.txt,sha256=sW247zZUMxm0b5UKYvPuqQQljYDtU-j2zK3cu7gHwM0,41
25
- engin-0.1.0b3.dist-info/licenses/LICENSE,sha256=XHh5LPUPKZWTBqBv2xxN2RU7D59nHoiJGb5RIt8f45w,1070
26
- engin-0.1.0b3.dist-info/RECORD,,
22
+ engin-0.1.0b4.dist-info/METADATA,sha256=GrfuoOkM35Dcjdjzf22LlZ_EgHhn7KtzMGEOybLhoxo,3201
23
+ engin-0.1.0b4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
+ engin-0.1.0b4.dist-info/entry_points.txt,sha256=sW247zZUMxm0b5UKYvPuqQQljYDtU-j2zK3cu7gHwM0,41
25
+ engin-0.1.0b4.dist-info/licenses/LICENSE,sha256=XHh5LPUPKZWTBqBv2xxN2RU7D59nHoiJGb5RIt8f45w,1070
26
+ engin-0.1.0b4.dist-info/RECORD,,