On Tue, Feb 10, 2015 at 10:59 AM, Alexander Broekhuis <[email protected]> wrote: > 2015-02-10 10:53 GMT+01:00 Pepijn Noltes <[email protected]>: > >> On Tue, Feb 10, 2015 at 10:35 AM, Alexander Broekhuis >> <[email protected]> wrote: >> > 2015-02-10 9:56 GMT+01:00 Pepijn Noltes <[email protected]>: >> > >> >> >> >> > Daniel raised this issue, and I'm not yet sure how to fully solve it. >> If >> >> > anyone has any ideas, please add those to the issue. >> >> >> >> Well reading the requirements for calling curl_global_init I only see >> >> one option, if we want to use curl: Adding a doing the init in the >> >> celix framework and as result add curl as a "default" library. >> >> >> > >> > Whatever fix we try, we should try to keep the framework clean. Perhaps >> it >> > is an idea to do this in a specific launcher? Or as an option with the >> > current launcher? >> >> I would also prefer a clean framework. But I am afraid that the >> workaround makes everything unnecessary complex. >> Multiple launcher / additional options needed to get a correct >> function system. In that case I would prefer a "hack" in the >> framework. >> > > I strongly disagree with this. The launcher is just a small source file. It > is easy enough to duplicate or add an option. I don't see how that makes > anything complex. > > But even if we don't want an option/multiple launchers, I (against my > better judgement wrt OSGi concepts..) prefer to add it to the current > launcher, this at least leaves the framework clean. If someone creates a > custom launcher, they don't have to rely on curl, on the other hand, if > they want to use it, they have to add it (easy enough..).
To clarify I would prefer a curl bundle to disclose the curl functionality as this is IMO the OSGi way. You can hide implementation details (init/deinit) in the bundle activator and disclose functionality based on an abstracted services. But because curl_global_init has to be called before any threads are started, this is not an option. Well then I prefer a manner where we leak as less as possible implementation details. IMO this can be achieved by default doing curl_global_init / deinit in the Celix Framework. Adding options, we enforces people to think about curl init/deinit. Although a small inconvenience, if this is avoidable I would prefer that. I agree that if we do this, it should be done in the launcher. Just my 2 cents. Greetings, Pepijn
