|
66 | 66 | * constraints in the queues. |
67 | 67 | * <p> |
68 | 68 | * When sending, queues are polled in order. Order is kept by a queue of queues. This outer queue can have multiple |
69 | | - * entries of the same transaction queue. Every time the transaction manager is called to send a transaction, the |
| 69 | + * entries of the same transaction queue. Every time the transaction manager is called to send a transaction, the |
70 | 70 | * transaction will be a added to a respective transaction queue which will be added to the outer queue. |
71 | 71 | * Every time a transaction queue is polled from the outer queue only one single transaction is attempted to be sent. |
72 | 72 | * If no transaction is retrieved from the transaction queue (e.g. due to inter-transaction delays) the transaction is |
@@ -399,17 +399,17 @@ private ZigBeeTransactionQueue getTransactionQueue(ZigBeeTransaction transaction |
399 | 399 | return defaultQueue; |
400 | 400 | } |
401 | 401 | // Add the transaction to the device queue - if it doesn't currently exist, create it |
402 | | - return nodeQueue.compute(node.getIeeeAddress(), (nodeAddress, queue) -> { |
403 | | - if (queue == null && createIfNotExist) { |
404 | | - logger.debug("{}: Creating new Transaction Queue", node.getIeeeAddress()); |
405 | | - ZigBeeTransactionQueue createdQueue = new ZigBeeTransactionQueue(node.getIeeeAddress().toString(), |
406 | | - node.getIeeeAddress()); |
407 | | - setQueueType(node, createdQueue); |
408 | | - |
409 | | - return createdQueue; |
410 | | - } |
411 | | - return queue; |
412 | | - }); |
| 402 | + ZigBeeTransactionQueue queue = nodeQueue.get(node.getIeeeAddress()); |
| 403 | + if (queue == null && createIfNotExist) { |
| 404 | + logger.debug("{}: Creating new Transaction Queue", node.getIeeeAddress()); |
| 405 | + ZigBeeTransactionQueue createdQueue = new ZigBeeTransactionQueue(node.getIeeeAddress().toString(), |
| 406 | + node.getIeeeAddress()); |
| 407 | + setQueueType(node, createdQueue); |
| 408 | + nodeQueue.put(node.getIeeeAddress(), createdQueue); |
| 409 | + |
| 410 | + return createdQueue; |
| 411 | + } |
| 412 | + return queue; |
413 | 413 | } else if (address instanceof ZigBeeEndpointAddress |
414 | 414 | && ZigBeeBroadcastDestination.isBroadcast(address.getAddress())) { |
415 | 415 | return broadcastQueue; |
|
0 commit comments