[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Synchronous and Asynchronous callbacks

Am Sonntag, 29. September 2019 01:02:48 UTC+2 schrieb Paul Rubin:
> Eko palypse <ekopalypse at gmail.com> writes:
> > Two dicts, one for sync and the other for async registrations?
> Why not make all the callbacks asynchronous?  Clients that don't want to
> handle a callback immediately can keep it pending until they are ready,
> perhaps in a queue.
> Whether this can work of course depends on how the application is put
> together, but the pattern of a bunch of asynchronous tasks communicating
> through fifos tends to work pretty well.  I'm used to doing it with
> threads, though those can be expensive if you use a lot of them.  I
> don't know whether async/await unavoidably complicates things.

Thank you very much for your answer.
Unfortunately, I can't make all callbacks synchronous or asynchronous because this has negative effects on the application in one way or another.

I also came across the asyncio methods yesterday, 
Whoa, what can I say, I haven't really understood yet.
My first impression is that either the whole library works asynchronously or not.
Still too many Bohemian villages (not sure if this is also common in English - it should say there are too many things I don't understand).

But as I said, thank you very much for the time and your thoughts you have given about my problem, very much appreciated.