mruby_nginx_module
mruby_nginx_module copied to clipboard
Deference between ngx_mruby
Hello @cubicdaiya! It`s really hard to understand deference between ngx_mruby and yours. Please help me understand!
- You want to develop nginx addons from ruby/mruby? So we have some nginx source C code and must to write nginx`s module as
struct ngx_command_t {
ngx_str_t name;
ngx_uint_t type;
char *(*set)(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
ngx_uint_t conf;
ngx_uint_t offset;
void *post;
};
and so on... classic nginx module structure
As I understand, we/you must generate C source module from template by ruby/mruby. We just create some wizard that help to answer questions?
For example choose what directive configuration we want use NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
static ngx_command_t ngx_http_gzip_static_commands[] = {
{ ngx_string("gzip_static"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
ngx_conf_set_enum_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(ngx_http_gzip_static_conf_t, enable),
&ngx_http_gzip_static },
ngx_null_command
};
Am I right? Or you want integrate full nginx API support from mruby and then we may make manipulations nginx`s behaviour without recompiling? If that? - It sounds fine!
Thx.
I see ngxmodgen. I`m going to add some fetures to it. Great! So, what about add all fetures for nginx module generation like in http://www.evanmiller.org/nginx-modules-guide.html
It`s really hard to understand deference between ngx_mruby and yours. Please help me understand!
The goal of the author of ngx_mruby is the unification of how to describe configuration and extension of web servers(Apache, nginx, Varnish, Apache Traffic Server, etc). This is one of his subject of research.
But what I want to develop is the nginx-specified product.
For example, Built-in Regexp, nginx-internal api bindings and so on. And I think it needs features for treating co-routine and non-blocking socket and sub-request though they are not implemented yet.
As it's soon after mruby_nginx_module is forked( at July 2013), There is not definitive difference between ngx_mruby very well at this time yet. Additionally, It is also the reason that ngx_mruby is reflected my design concept at this time. Because more than half of the features of ngx_mruby are implemented by me. But it would not for the feature.
Please see the following url about difference between ngx_mruby at this time.
https://github.com/cubicdaiya/mruby_nginx_module#difference-between-ngx_mruby
And if you know in more detail, pelase see the following page. mruby_nginx_module is full-documented except Built-in Regexp.
http://cubicdaiya.github.io/mruby_nginx_module/
In a simple term, what I want to develop is rather like the mruby version of lua-nginx-module.
But the goal of ngx_mruby is different from it. So I decided to fork after having a talk with him.
Or you want integrate full nginx API support from mruby and then we may make manipulations nginx`s behaviour without recompiling? If that?
Nearly yes.
I see ngxmodgen. I`m going to add some fetures to it. Great!
Thanks. I'm looking forward to see it.
Good job @cubicdaiya !
@cubicdaiya thanks! You opened my eyes. "^_^".open # => O_O
Year, Sysoev Igor saw about PCRE: "I know how it works, but I did not used it! And you will better to do so! Better use static directive
without any Regex"
Now I have a plan
-
First, not nil.
- Make small changes for mruby_nginx_module documentation: install script-text, add more example with nginx.conf_templates -
Analyze lua and perl binding work with nginx "API"
- nginx have specific "hard", but very productive plan work with buffers poll, often they did
t work with RAM (memcopy), just pass buffers handler address from module to module and async - it
s harder that write Apache modules.
-
List available features from lua, perl - make one tables = who.where.how
-
get all free-popular nginx modules + add it`s features to table + add what I or other want to see
-
make visual scheme - for better understanding
- try to understand how pass arguments and varible from module to module, when IN and when OUT
- update from trunk nginx_dev_module for last nginx sources (1.4, 1.5)
- update nginx_module_generator template, comment weach place, make wizzard for generate new module, add example techniks
-
benchmark all, test each other: lua, mruby, perl, native - redis, memcache, pg, drizzle
-
nginx patches from Openresty for Linux (Sysoev married FreeBSD)
-
port or try port to other platform ARM, MIPS
And @cubicdaiya excuse me, if Ill often make issue or PR in feature - I
m only learning
@charlescui
Thanks. Encouraging.
@mibamur
And @cubicdaiya excuse me, if Ill often make issue or PR in feature - Im only learning
Thanks. Both are always welcome.
As my comment in this issue includes the how and why of fork, I save this issue.