Oxen-AI / Oxen

Oxen.ai's core rust library, server, and CLI
https://oxen.ai
Apache License 2.0
178 stars 11 forks source link

Process background tasks in separate threads #347

Closed lewazo closed 3 months ago

lewazo commented 3 months ago

This uses tokio::task::spawn_blocking to start the background tasks in tokio's thread pool meant for code that's blocking.

The queue poller remains an async task, but will spawn new threads as soon as messages come.

This also extracts the code related to the poller out of main.