"I have to work in a language other than Erlang/Elixir and I don't like it"
But Erlang/Elixir are defined by the sort of concurrency model that you say you want, so as far as I can see your question would be just the same if you were asking about Java or Go.
If you have a question like "I can do this in Java or Go. How do I do it in Python?" Then people might be able to help. But please stop with the criticism of Python for not being Erlang/Elixir, since Java and Go also are not that.
This is honestly pretty frustrating trying to build a system like this in Python. If you think asyncio, coroutines, tasks, multiprocessing, threads, subprocesses, etc. are simple and understandable in Python, then I would love for someone to explain them to me in a way that is manageable.
And no, the question would not be the same. Java and Go have proper concurrency substrates. Python does not.
It definitely isn't, but this is a new role with a rushed timeline in a place dominated by Python.
> and it works but I find the code extremely hard to reason about
This is also a major concern of mine.
It may feel limiting but my advice would be to keep all the celery job queue stuff isolated from your server, especially if you are using an async web framework. Have your web server just put all the jobs in the celery queue and let it handle executing them, regardless of whether they’re cpu or io-bound. If you try to optimize too much by doing something like leaning on celery for cpu-bound tasks but letting your web server handle the io-bound ones you’re going to be in for a world of hurt when it comes to both debugging and enforcing the order of execution. Celery has its warts but you’ll at least know where in the system your problem is and have reasonably good control over the pipeline.
What about using Pkykka alongside Pyro such that each Pyro remote object is actually a Pykka actor? Such that Pyro allows splitting workers across separate Python OS processes and the "messaging" while Pykka handles the internal state.
In Python, it could be a class managing a session type of object, like a TCP socket connection, or managing some piece of hardware that is doing something independently of the other parts of the system, or a database writer, etc.