Open bitphage opened 5 years ago
I researched this topic a bit. In current WorkerInfrastructure() it's possible to initialize plugin tasks as a regular workers and allow them to set subscribe callbacks. Later, it will require a major refactoring when switching to asyncio core.
Another approach is to write plugins in async manner and run them inside a separate thread with dedicated asyncio loop. Example: https://hackernoon.com/controlling-python-async-creep-ec0a0f4b79ba . This will require much less refactoring later. Caveat: pybitshares is not thread-safe, so plugin thread will require a separate BitShares() instance.
We need to run a non-market worker tasks inside dexbot, like history downloading or analysis workers or whatever.
To achieve this, we may extend WorkerInfrastructure() class by importing and launching "plugin" tasks.