docs
This commit is contained in:
@@ -92,6 +92,12 @@ class Obs(private val q:BlockingQueue<Op>): AutoCloseable {
|
|||||||
private fun onReady() {
|
private fun onReady() {
|
||||||
log.info("ready")
|
log.info("ready")
|
||||||
ready.set(true)
|
ready.set(true)
|
||||||
|
// The docs say that you are only supposed to send requests from the [onReady] handler,
|
||||||
|
// but you cannot block the [onReady] handler.
|
||||||
|
// (If you block the [onReady] handler other handlers are not called. [onDisconnect] is not called so you
|
||||||
|
// cannot reconnect if OBS is restarted.)
|
||||||
|
// This would be fine if `onReady` was called after each response, but it is not.
|
||||||
|
// So we keep track of if it is ready, and make requests from another thread ([opThread]).
|
||||||
}
|
}
|
||||||
|
|
||||||
private val opThread = thread(name="obs-op", isDaemon=false, start=true) {
|
private val opThread = thread(name="obs-op", isDaemon=false, start=true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user