Using spymemcached in a netty based project
I'd like to use spymemcached in a project based on netty. Netty's threading model uses 'boss' and 'worker' threads where none of the threads performs a wait for I/O or other external activity. The model used by spymemcached assumes that a thread uses a future to wait for completion of an operation. Internally spymemcached has a operation model with callbacks on activity completion.
In order to use these libraries together I see two alternatives:
1) Create a separate netty thread pool for spymemcached operations. This pool is independent of the main netty worker thread pool. Spymemcached operations are initiated and wait for completion using these threads.
2) Add support for listeners within spymemcached Callback classes that would be notified on operation completion. This allow passing results directly to the netty worker thread pool. This follows the netty threading model more closely and makes more efficient use of threads since spymemcached already has a worker thread that is performing I/O activity.
I would prefer to use option 2. Is option 2 something that spymemcached has considered? Do the developers have any thoughts on its viability?