Skip to content

jbrisbin/riak_core_v8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

V8-based VNode Executor

The idea here is to embed the V8 Javascript VM (via erlv8) into a riak_core vnode such that one could export a set of functions as a CommonJS module and have the riak_core vnode dispatch calls into this Javascript module.

An example Javascript file might look like:

var core = require("riak_core");

(function() {

  exports.handle_command = function(msg) {
    return core.reply({
      "result": "result value"
    });
  }

  exports.handle_info = function(msg) {
    return core.OK;
  }

  exports.handle_coverage = function(req, keySpaces) {
    return core.CONTINUE;
  }

})();

The vnode that receives the "handle_command" message will pass it along to this Javascript function, turning any arguments into a Javascript object.

About

Embed V8 Javascript into a riak_core vnode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published