You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Simone Caruso <in...@simonecaruso.com> on 2011/03/26 15:48:52 UTC

module interaction

I have made 2 modules for different scopes, now i would like let them comunicate,
there is an interface that permits me do this without using files ?

Being loaded together can i call module2's functions from module1 and vice versa?


-- 
Simone Caruso
IT Consultant

Re: module interaction

Posted by Simone Caruso <in...@simonecaruso.com>.
On 27/03/2011 01:04, Ben Noordhuis wrote:
> On Sun, Mar 27, 2011 at 00:23, Simone Caruso<in...@simonecaruso.com>  wrote:
>> I think provider or apr_optional are what i'm looking for,
>> i read mod_authnz_ldap for a provider sample and mod_ldap for apr_optional,
>> maybe i have understood the logic, but... i don't understand the difference
>> between these two approaches..
>> there is a doc or someone can explain it ?
>
> Providers are for when you have some common functionality that has
> more than one implementation. Example: a session cache mechanism with
> an in-memory and an on-disk implementation.
>
> Optional functions let you expose your functions to other modules.
> Example: mod_foo exports a function get_num_processed_requests() that
> mod_bar calls when it generates a status page.
>
> I wager that optional functions are what you're looking for.
You are right, optional functions are enough to solve my problem...
thanks Ben!

-- 
Simone Caruso
IT Consultant

Re: module interaction

Posted by Ben Noordhuis <in...@bnoordhuis.nl>.
On Sun, Mar 27, 2011 at 00:23, Simone Caruso <in...@simonecaruso.com> wrote:
> I think provider or apr_optional are what i'm looking for,
> i read mod_authnz_ldap for a provider sample and mod_ldap for apr_optional,
> maybe i have understood the logic, but... i don't understand the difference
> between these two approaches..
> there is a doc or someone can explain it ?

Providers are for when you have some common functionality that has
more than one implementation. Example: a session cache mechanism with
an in-memory and an on-disk implementation.

Optional functions let you expose your functions to other modules.
Example: mod_foo exports a function get_num_processed_requests() that
mod_bar calls when it generates a status page.

I wager that optional functions are what you're looking for.

Re: module interaction

Posted by Simone Caruso <in...@simonecaruso.com>.
On 26/03/2011 22:18, Ben Noordhuis wrote:
> On Sat, Mar 26, 2011 at 16:09, Brian McQueen<mc...@gmail.com>  wrote:
>> If you want to share functions then put them into a library and they
>> will be shared in the usual way like normal c functions. If you want
>> to pass data between modules there are are notes and environment.
>
I need to access other module configuration...

> This. And there is also the provider API and the optional function
> stuff in ap_provider.h and apr_optional.h.

I think provider or apr_optional are what i'm looking for,
i read mod_authnz_ldap for a provider sample and mod_ldap for apr_optional,
maybe i have understood the logic, but... i don't understand the difference between these two approaches..
there is a doc or someone can explain it ?



-- 
Simone Caruso
IT Consultant

Re: module interaction

Posted by Ben Noordhuis <in...@bnoordhuis.nl>.
On Sat, Mar 26, 2011 at 16:09, Brian McQueen <mc...@gmail.com> wrote:
> If you want to share functions then put them into a library and they
> will be shared in the usual way like normal c functions. If you want
> to pass data between modules there are are notes and environment.

This. And there is also the provider API and the optional function
stuff in ap_provider.h and apr_optional.h.

Re: module interaction

Posted by Brian McQueen <mc...@gmail.com>.
If you want to share functions then put them into a library and they
will be shared in the usual way like normal c functions. If you want
to pass data between modules there are are notes and environment.



On 3/26/11, Simone Caruso <in...@simonecaruso.com> wrote:
>
> I have made 2 modules for different scopes, now i would like let them
> comunicate,
> there is an interface that permits me do this without using files ?
>
> Being loaded together can i call module2's functions from module1 and vice
> versa?
>
>
> --
> Simone Caruso
> IT Consultant
>

-- 
Sent from my mobile device

Make a Small Loan, Make a Big Difference - Check out Kiva.org to Learn How!