Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /rpidhe_chainlit-pypi /cypress /e2e /context /main.py
| from chainlit.context import context | |
| from chainlit.sync import make_async, run_sync | |
| import chainlit as cl | |
| async def async_function_from_sync(): | |
| await cl.sleep(2) | |
| return context.emitter | |
| def sync_function(): | |
| emitter_from_make_async = context.emitter | |
| emitter_from_async_from_sync = run_sync(async_function_from_sync()) | |
| return (emitter_from_make_async, emitter_from_async_from_sync) | |
| async def async_function(): | |
| return await another_async_function() | |
| async def another_async_function(): | |
| await cl.sleep(2) | |
| return context.emitter | |
| async def main(): | |
| emitter_from_async = await async_function() | |
| if emitter_from_async: | |
| await cl.Message(content="emitter from async found!").send() | |
| else: | |
| await cl.ErrorMessage(content="emitter from async not found").send() | |
| emitter_from_make_async, emitter_from_async_from_sync = await make_async( | |
| sync_function | |
| )() | |
| if emitter_from_make_async: | |
| await cl.Message(content="emitter from make_async found!").send() | |
| else: | |
| await cl.ErrorMessage(content="emitter from make_async not found").send() | |
| if emitter_from_async_from_sync: | |
| await cl.Message(content="emitter from async_from_sync found!").send() | |
| else: | |
| await cl.ErrorMessage(content="emitter from async_from_sync not found").send() | |
Xet Storage Details
- Size:
- 1.35 kB
- Xet hash:
- 493ec07474966914829441a659e36edce18e9849addf61653d6c466059d48d37
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.