Feature #4230
closedlibrados: node.js bindings
0%
Description
Although I don't have a use-case at this specific point it would be very cool to have node.js bindings.
From the docs it seems pretty simple to write these bindings and make cool stuff with it.
I'm just opening the feature here so that it shows up and can be picked up:
Some reference docs:- http://nodejs.org/api/addons.html#addons_wrapping_c_objects
- http://www.slideshare.net/nsm.nikhil/writing-native-bindings-to-nodejs-in-c
- https://github.com/nikhilm/jsfoo-pune-2012
Without bindings you would be able to use node-ffi, but I think native bindings would be cleaner: https://github.com/rbranson/node-ffi
Updated by Alexandre Marangone about 11 years ago
Email was rejected by redmine. This was sent to ceph-devel:
----
Hi Wido,
Also cc'ing ceph-devel.
Few months ago I started to write node bindings to librados. No
specific use case either, just curious to learn a little bit more
about v8 and librados.
My first work was to do a 1:1 wrapping, but it wasn't javascripty enough.
I started over and was able to do stuff like:
var librados = require('./build/Release/nrados');
var rados = new librados.Rados({
'user': 'admin',
'keyring': '/etc/ceph/keyring',
'monitors': '[ 192.168.0.20 ]'
});
var ioctx = new librados.IoCtx();
rados.connect(function (err) {
if (err)
throw err;
rados.ioctx_create('mypool', ioctx, function (err) {
if (err)
throw err;
ioctx.write_full('myobject1', 'aa');
});
});
Which is better, but still, clumsy (I want to get rid of ioctx_create).
I need to put some thoughts into the overall design.
I didn't touch the code for about two months, and couldn't find it
this morning. As soon as I figure out where it is, I'll create a
github repo.
Of course, thoughts and suggestions are welcome.
--
Alexandre
---
Updated by Loïc Dachary over 9 years ago
- Status changed from New to Resolved