pnoltes commented on code in PR #729: URL: https://github.com/apache/celix/pull/729#discussion_r1501905658
########## libs/framework/include/celix_bundle_context.h: ########## @@ -393,50 +388,218 @@ CELIX_FRAMEWORK_EXPORT long celix_bundleContext_findServiceWithOptions(celix_bun CELIX_FRAMEWORK_EXPORT celix_array_list_t* celix_bundleContext_findServicesWithOptions(celix_bundle_context_t *ctx, const celix_service_filter_options_t *opts); /** - * @brief Track the highest ranking service with the provided serviceName. + * @brief Use the service with the provided service id using the provided callback. The Celix framework will ensure that + * the targeted service cannot be removed during the callback. + * + * The svc is should only be considered valid during the callback. + * If no service is found, the callback will not be invoked and this function will return false immediately. + * + * This function will block until the callback is finished. As result it is possible to provide callback data from the + * stack. + * + * @param ctx The bundle context + * @param serviceId the service id. + * @param serviceName the service name of the service. Should match with the registered service name of the provided service id (sanity check) + * @param callbackHandle The data pointer, which will be used in the callbacks + * @param use The callback, which will be called when service is retrieved. + * @param bool returns true if a service was found. + */ +CELIX_FRAMEWORK_EXPORT bool celix_bundleContext_useServiceWithId( Review Comment: I will also check if the `celix_bundleContext_useService*` functions can be refactored to use the `celix_bundleContext_trackServicesWithOptions` with `celix_bundleContext_useTrackedService*` functions. This will change the behavior of the `celix_bundleContext_useService*` calls to de facto always be a direct use call. But maybe the impact is small, because this will simplify the bundle context impl. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org