Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added mule support for v8

  • Loading branch information...
commit 2b7f25054fa1c0f6b92ac56fefec23d8aedfbc48 1 parent bb3f6bc
@unbit authored
Showing with 14 additions and 0 deletions.
  1. +2 −0  plugins/v8/plugin.c
  2. +12 −0 plugins/v8/v8_uwsgi.cc
View
2  plugins/v8/plugin.c
@@ -7,6 +7,7 @@ uint16_t uwsgi_v8_rpc(void *, uint8_t, char **, uint16_t *, char *);
int uwsgi_v8_signal_handler(uint8_t, void *);
void uwsgi_v8_init_thread(int);
void uwsgi_v8_enable_threads();
+int uwsgi_v8_mule(char *);
static void uwsgi_v8_register(void) {
uwsgi_register_configurator(".js", uwsgi_v8_configurator);
@@ -30,4 +31,5 @@ struct uwsgi_plugin v8_plugin = {
.signal_handler = uwsgi_v8_signal_handler,
.enable_threads = uwsgi_v8_enable_threads,
.init_thread = uwsgi_v8_init_thread,
+ .mule = uwsgi_v8_mule,
};
View
12 plugins/v8/v8_uwsgi.cc
@@ -30,6 +30,7 @@ extern struct uwsgi_plugin v8_plugin;
struct uwsgi_option uwsgi_v8_options[] = {
{(char *)"v8-load", required_argument, 0, (char *)"load a javascript file", uwsgi_opt_add_string_list, &uv8.load, 0},
{(char *)"v8-preemptive", required_argument, 0, (char *)"put v8 in preemptive move (single isolate) with the specified frequency", uwsgi_opt_set_int, &uv8.preemptive, 0},
+ {(char *)"v8-gc-freq", required_argument, 0, (char *)"set the v8 garbage collection frequency", uwsgi_opt_set_64bit, &uv8.gc_freq, 0},
{0, 0, 0, 0},
};
@@ -330,3 +331,14 @@ extern "C" int uwsgi_v8_signal_handler(uint8_t sig, void *handler) {
while(!v8::V8::IdleNotification()) {};
return ret;
}
+
+extern "C" int uwsgi_v8_mule(char *opt) {
+
+ if (uwsgi_endswith(opt, (char *)".js")) {
+ uwsgi_v8_load_file(0, opt);
+ return 1;
+ }
+
+ return 0;
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.