MCPcopy
hub / github.com/benoitc/gunicorn / generate

Function generate

examples/celery_alternative/app.py:157–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155 With dirty arbiters, progress is streamed in real-time!
156 """
157 async def generate():
158 try:
159 client = await get_dirty_client_async()
160 async for progress in client.stream_async(
161 EMAIL_WORKER,
162 "send_bulk_emails",
163 recipients=data.recipients,
164 subject=data.subject,
165 body=data.body,
166 ):
167 yield f"data: {json.dumps(progress)}\n\n"
168 except DirtyError as e:
169 yield f"data: {json.dumps({'error': str(e)})}\n\n"
170
171 return StreamingResponse(
172 generate(),

Callers 3

send_bulk_emailsFunction · 0.70
process_image_batchFunction · 0.70
run_etlFunction · 0.70

Calls 2

get_dirty_client_asyncFunction · 0.90
stream_asyncMethod · 0.80

Tested by

no test coverage detected