Forum: NGINX question on module user context

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Delta Y. (Guest)
on 2009-04-11 19:12
(Received via mailing list)
Hi ,
  If I set a context to a module with   ngx_http_set_ctx(r, c, module)
 Is this context valid only for current http request?
Should I set the context for each new http request?


BR,
DeltaY
Maxim D. (Guest)
on 2009-04-11 19:28
(Received via mailing list)
Hello!

On Sat, Apr 11, 2009 at 11:04:14PM +0800, Delta Y. wrote:

> Hi ,
>   If I set a context to a module with   ngx_http_set_ctx(r, c, module)
>  Is this context valid only for current http request?

Yes.

> Should I set the context for each new http request?

No, only for requests where you actually need context.

Maxim D.
Delta Y. (Guest)
on 2009-04-11 19:41
(Received via mailing list)
2009/4/11 Maxim D. <removed_email_address@domain.invalid>

> > Should I set the context for each new http request?
>
> No, only for requests where you actually need context.
>

So the context is used for the scenario that the handler callback will
be
called multiple times to process the http request ?
Maxim D. (Guest)
on 2009-04-11 23:58
(Received via mailing list)
Hello!

On Sat, Apr 11, 2009 at 11:33:22PM +0800, Delta Y. wrote:

> > Yes.
> >
> > > Should I set the context for each new http request?
> >
> > No, only for requests where you actually need context.
> >
>
> So the context is used for the scenario that the handler callback will be
> called multiple times to process the http request ?

Yes, it's used to preserve some request-related state between
invocations of your module code.

Maxim D.
This topic is locked and can not be replied to.