@Override
    public CompletableFuture<PlcSubscriptionResponse> subscribe(PlcSubscriptionRequest subscriptionRequest) {
        LOGGER.info("subscribing {}", subscriptionRequest);
        Map<String, PlcResponseItem<PlcSubscriptionHandle>> values = new HashMap<>();
        subscriptionRequest.getTagNames().forEach(name -> {
            LOGGER.info("creating handle for tag name {}", name);
            PlcSubscriptionHandle handle = new DefaultPlcSubscriptionHandle(this);
            final PlcSubscriptionTag subscriptionTag = subscriptionRequest.getTag(name);
            switch (subscriptionTag.getPlcSubscriptionType()) {
                case CYCLIC:
                    LOGGER.info("Adding cyclic subscription for tag name {}", name);
                    device.addCyclicSubscription(dispatchSubscriptionEvent(name, handle), handle, subscriptionTag, subscriptionTag.getDuration().orElseThrow(RuntimeException::new));
                    break;
                case CHANGE_OF_STATE:
                    LOGGER.info("Adding change of state subscription for tag name {}", name);
                    device.addChangeOfStateSubscription(dispatchSubscriptionEvent(name, handle), handle, subscriptionTag);
                    break;
                case EVENT:
                    LOGGER.info("Adding event subscription for tag name {}", name);
                    device.addEventSubscription(dispatchSubscriptionEvent(name, handle), handle, subscriptionTag);
                    break;
            }
            values.put(name, new DefaultPlcResponseItem<>(PlcResponseCode.OK, handle));
        });

        PlcSubscriptionResponse response = new DefaultPlcSubscriptionResponse(subscriptionRequest, values);
        return CompletableFuture.completedFuture(response);
    }
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