Apologies in advance, this is a stream of brain farts and ultimately I was looking for peoples use cases for the two and what might be better.
I have an app that has lots of users sharing data that might be updated by another user. If the change by one affects another, that data is shared, crowd sourced data as such.
My intention is to email other users about the change so they can log in and view it and decide to take any actions. I’m using transactions for this to avoid database conflicts if users are updating data another is using etc.
I’m a neat freak… I like to keep my functions in separate modules, so all my email functions are in one module and database modules in another and import the ones I want from the email modules and call them within a database function that then searches a datatable looking for linked users, builds reports, csv’s, fires out emails etc (it could probably be more streamlined…) but this is slowing things down as I need to wait for the email function to finish before carrying on and returning data to the client for the current user who is making changes.
So, I was looking at the Nonblocking module of Anvil Extras (I’m using other modules from it) so from a server function I can call the email function that gathers the users from the database linked that same data, do its job whilst the function that called it carries on doing its thing. From what I can tell Nonblocking and asyncio are similar, but is there any advantage of one over another in this use? I have read numerous posts and as much as I can on each and should really just stop reading and start testing…