You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/03/22 09:24:00 UTC

[plc4x] branch develop updated: fix(plc4go/cbus): discover should not block anymore

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new c032651732 fix(plc4go/cbus): discover should not block anymore
c032651732 is described below

commit c0326517329ad43046f0ab2fd3166aa2bcb4b204
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Mar 22 10:23:47 2023 +0100

    fix(plc4go/cbus): discover should not block anymore
---
 plc4go/internal/cbus/Discoverer.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/plc4go/internal/cbus/Discoverer.go b/plc4go/internal/cbus/Discoverer.go
index 1523cfa17f..ebaffa87f2 100644
--- a/plc4go/internal/cbus/Discoverer.go
+++ b/plc4go/internal/cbus/Discoverer.go
@@ -132,9 +132,11 @@ func (d *Discoverer) Discover(ctx context.Context, callback func(event apiModel.
 		close(transportInstances)
 	}()
 
-	for transportInstance := range transportInstances {
-		d.deviceScanningQueue.Submit(ctx, 0, d.createDeviceScanDispatcher(transportInstance.(*tcp.TransportInstance), callback))
-	}
+	go func() {
+		for transportInstance := range transportInstances {
+			d.deviceScanningQueue.Submit(ctx, 0, d.createDeviceScanDispatcher(transportInstance.(*tcp.TransportInstance), callback))
+		}
+	}()
 	return nil
 }