|
When did you last use sanic? It's far from limited, and advancing quickly. However, it's a microframework, so it's true that you'll not get a full Django-like experience (and Meteor isn't even in the same class of web framework as Django or microframeworks like Sanic, so there's nothing to compare there either). But with respect to microframeworks, Sanic is getting pretty close to feature parity with Flask, only asynchronously. I'm not sure what kind of plugin architecture you're looking for, but you can do middleware with Sanic. Also custom protocols. Also decorators (e.g., for auth). And for namespacing, there are blueprints. I'm not sure what you mean by "conf hooks". It does help with Sanic if you're already familiar with Flask. Sanic is very close to an async version of Flask. For a task queue, you can run async tasks with Sanic alone using `app.add_task(some_async_function)`. It's also simple to use apscheduler if you want a more full-feature async scheduler. Example: from apscheduler.schedulers.asyncio import AsyncIOScheduler
from sanic import Sanic
app = Sanic()
async def tick():
print('Work!')
@app.listener('before_server_start')
async def initialize_scheduler(app, loop):
scheduler = AsyncIOScheduler({'event_loop': loop})
scheduler.add_job(tick, 'interval', seconds=1)
scheduler.start()
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000, debug=True)
Finally, unless things have changed, you should be able to set event loop policy with `asyncio.set_event_loop_policy`, have you tried it? |