Adam Hopkins

Results 354 comments of Adam Hopkins

Thanks for reporting. This is a known issue I will be pushing out a patch to v22.6 in the coming days: https://github.com/sanic-org/sanic/pull/2522/files

Will repond in more detail soon, just wanted to make a couple quick clarifications: - called or not is fine in `add_task` - before there is a loop or after...

Yes, that makes absolute sense. When there are multiple workers the main process (which is where you are instantiating the coroutine) does not execute listeners.

@gatopeich Would you care to share a snippet of your solution? Maybe it's worthwhile to add to the docs.

@gabhijit Would you care to take a stab at adding to the docs? https://github.com/sanic-org/sanic-guide/blob/main/src/en/guide/basics/tasks.md

> Should probably deprecate passing a coroutine object to avoid this problem. I wonder how much trouble it would cause app developers if we gave deprecation warnings or eventually removed...

> I think that might change the behavior of this functionality. How so? > Do you guys think adding built-in support in Sanic to let it only runs on one...

@henryk is correct. There is some inconsistency here and there needs to be an overhaul to bring it all together. This is a bit of an effort in identifying some...

Hmm... news to me. Funny that none of the unit tests caught this. But, this is suspect, because we certainly do! ``` INFO: ASGI 'lifespan' protocol appears unsupported. ```

I see the problem. Will release a patch tomorrow.