private Consumer<PlcValue> dispatchSubscriptionEvent(String name, PlcSubscriptionHandle handle) {
        return plcValue -> {
            LOGGER.info("handling plc value {}", plcValue);
            PlcConsumerRegistration plcConsumerRegistration = registrations.get(handle);
            if (plcConsumerRegistration == null) {
                LOGGER.warn("no registration for handle {}", handle);
                return;
            }
            int consumerId = plcConsumerRegistration.getConsumerId();
            Consumer<PlcSubscriptionEvent> consumer = consumerIdMap.get(consumerId);
            if (consumer == null) {
                LOGGER.warn("no consumer for id {}", consumerId);
                return;
            }
            consumer.accept(
                new DefaultPlcSubscriptionEvent(
                    Instant.now(),
                    Collections.singletonMap(name, new DefaultPlcResponseItem<>(PlcResponseCode.OK, plcValue))
                )
            );
        };
    }
Blocking subscribe call

@param subscriptionRequest subscription request containing at least one subscription request item.
@return the {@code PlcSubscriptionResponse}
plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/SimulatedConnection.java