PengZheng commented on code in PR #729: URL: https://github.com/apache/celix/pull/729#discussion_r1502365505
########## 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 tried to make direct use the default before. IIRC, there are deadlocks in pubsub. Now that pubsub has been removed, I think it is safe to try again. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
