pnoltes commented on code in PR #729:
URL: https://github.com/apache/celix/pull/729#discussion_r1501844442


##########
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 agree. I marked them deprecated. IMO they should be removed before a 3.0.0 
release. 
   
   Note that the `celix_bundleContext_useService*` and 
`celix::BundleContext::useService*` are used, but mostly (if not only) in test 
code. So removal of these functions/methods will be a large PR (code changes 
wise). 
   
   Also I removed the `waitTimeoutInSeconds` options in the 
`celix_tracked_service_use_options_t`. This options is confusing (not useable 
in useServices (plural)) and also only used in testing. For testing purpose, 
maybe we should add some utils functions (e.g. 
`celix::testing::waitForNrOfTrackerServices`, 
`celix::testing::waitForNrOfStartedBundles`, etc). 
    



-- 
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

Reply via email to