uWSGI V8支持

Building

需要 libv8 头文件来构建该插件。官方用于V8的modifier1值为 ‘24’.

RPC

function part1(request_uri, remote_addr) {
     return '<h1>i am part1 for ' + request_uri + ' ' + remote_addr + "</h1>" ;
}

function part2(request_uri, remote_addr) {
     return '<h2>i am part2 for ' + request_uri + ' ' + remote_addr + "</h2>" ;
}

function part3(request_uri, remote_addr) {
     return '<h3>i am part3 for ' + request_uri + ' ' + remote_addr + "</h3>" ;
}

uwsgi.register_rpc('part1', part1);
uwsgi.register_rpc('part2', part2);
uwsgi.register_rpc('part3', part3);

ciao = function(saluta) {
     uwsgi.log("I have no idea what's going on.");
     return "Ciao Ciao";
}

uwsgi.register_rpc('hello', ciao);

信号处理函数

function tempo(signum) {
     uwsgi.log("e' passato 1 secondo");
}

uwsgi.register_signal(17, '', tempo);

多线程和多进程

Mule

uWSGI API

JSGI 3.0

exports.app = function (request) {
 uwsgi.log("Hello! I am the app.\n");
 uwsgi.log(request.scheme + ' ' + request.method + ' ' + request.scriptName + ' ' + request.pathInfo + ' ' + request.queryString + ' ' + request.host);
 uwsgi.log(request.serverSoftware);
 return {
     status: 200,
     headers: {"Content-Type": "text/plain", "Server": ["uWSGI", "v8/plugin"]},
     body: ["Hello World!", "I am V8"]
 };
}
uwsgi --plugin v8 --v8-jsgi myapp.js --http-socket :8080 --http-socket-modifier1 24

CommonJS

  • Require: OK
  • Binary/B: NO
  • System/1.0: 进行中
  • IO/A: NO
  • Filesystem/A: NO