mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 09:52:09 +01:00
Adding more logging around zmq connection
This commit is contained in:
parent
11e365a511
commit
d4bef008e5
@ -38,8 +38,9 @@ class ZMQSubscriber(
|
||||
|
||||
def start()(implicit ec: ExecutionContext): Future[Unit] = Future {
|
||||
logger.info("starting zmq")
|
||||
subscriber.connect(uri)
|
||||
logger.info("Connection to zmq client successful")
|
||||
val connected = subscriber.connect(uri)
|
||||
if (connected) {
|
||||
logger.info(s"Connection to zmq client successful to $uri")
|
||||
//subscribe to the appropriate feed
|
||||
hashTxListener.map { _ =>
|
||||
subscriber.subscribe(HashTx.topic.getBytes(ZMQ.CHARSET))
|
||||
@ -72,6 +73,11 @@ class ZMQSubscriber(
|
||||
logger.error(err.getMessage)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.info(s"Failed to connect zmq client to $uri")
|
||||
Future.failed(throw new IllegalArgumentException(s"Failed to connect zmq client to $uri"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,7 +93,8 @@ class ZMQSubscriber(
|
||||
context.term()
|
||||
}
|
||||
|
||||
/** Processes a message that we received the from the cryptocurrency daemon and then
|
||||
/**
|
||||
* Processes a message that we received the from the cryptocurrency daemon and then
|
||||
* applies the appropriate listener to that message.
|
||||
*/
|
||||
private def processMsg(topic: String, body: Seq[Byte])(implicit ec: ExecutionContext): Future[Unit] = {
|
||||
|
Loading…
Reference in New Issue
Block a user