mschneider / solcpp

A fast Solana and Mango Markets C++ SDK
Other
39 stars 12 forks source link

Websocket callback on thread pool #76

Closed godmodegalactus closed 1 year ago

godmodegalactus commented 1 year ago

In current websocket in method on_read we call the callback (cb) on the same thread. If the callback is time consuming it will reduce the through put for websocket.

So instead of callback on the same thread you should do callback on a special pre configured thread pool. I encourage to make the read thread as free as possible moving also subscription and unsubscription processing on the thread pool.