opensensorhub / osh-core

OpenSensorHub Core Modules
http://docs.opensensorhub.org
Mozilla Public License 2.0
32 stars 16 forks source link

Asynchronous feature registration makes it difficult to add new FOIs after sensor startup in v2 #181

Closed csdillard closed 3 years ago

csdillard commented 3 years ago

When a sensor driver publishes an FoiEvent for a new FOI, the sensorhub node registers the feature asynchronously. However, there is no way for the sensor to find out when the asynchronous registration is complete. If the sensor immediately emits a DataEvent for the new feature, it will often fail with an "Unknown FOI" exception.

Should handleEvent(...) call .get() on the CompletableFuture returned by register?

alexrobin commented 3 years ago

Closed in 7bd98faa.

Please call addFoi() method rather than sending events to register a new feature of interest before related observations are pushed to the bus.