Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I share some vars to the http block #45

Closed
jeppojeps opened this issue Nov 2, 2016 · 4 comments
Closed

Can I share some vars to the http block #45

jeppojeps opened this issue Nov 2, 2016 · 4 comments

Comments

@jeppojeps
Copy link

Hello I am working with the ngx_stream_ssl_preread_module and I would like to share some vars between stream and http blocks. In the http block I am using LUA, I was thinking that maybe with stream-lua I'd be able to share some data, but it looks like I can't do that. because IMHO 2 different LUA interpreters will be launched for the 2 modules. If you have any hints they'd be welcome.

Thanks,
Jeppo

@agentzh
Copy link
Member

agentzh commented Nov 3, 2016

@jeppojeps Right, they are separate subsystems in NGINX and also separate Lua VM instances. We might be able to share lua_shared_dict zones across the http and stream subsystems in the near future though.

@jeppojeps
Copy link
Author

Hello, I am playing with the shared vars, I have created a new directive and modified the handler function copying it from the shared dict of stream, my change is in the call of ngx_shared_memory_add, instead of passing the stream_lua_module I am giving the http_core_module, it looks like the var is created but I can't access it from http, is there any other modification that I need to handle to make it work?

@agentzh
Copy link
Member

agentzh commented Nov 15, 2016

@jeppojeps Read the discussion here:

#36

@dndx
Copy link
Member

dndx commented Feb 26, 2018

Hello,

In the long term we will probably make shdict shareable between subsystems. But will unlikely share Lua VM or NGINX variables across subsystems for sanity reasons.

@dndx dndx closed this as completed Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants