muffin
muffin copied to clipboard
@app.task descriptor not working
Describe the bug run_after_response example does not work. AttributeError: 'Application' object has no attribute 'task'
To Reproduce Steps to reproduce the behavior:
from muffin import Application
app = Application()
@app.task
def send_email(email, message):
# send email here
pass
@app.route('/send')
async def send(request):
# Schedule any awaitable for later execution
app.run_after_response(send_email('[email protected]', 'Hello from Muffin!'))
# Return response to a client immediately
# The task will be executed after the response is sent
return "OK"
Desktop (please complete the following information): muffin 0.100.1