Oxen-AI / Oxen

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

Process background tasks in separate threads #347

Closed lewazo closed 5 months ago

lewazo commented 5 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.