-
haXe, Node.js, Remote Data Sneak Peak
I recently posted a haxe data store I’m working on here
https://github.com/cloudshift/Data
it has persistent hashes and indexable/relatable buckets.
example here https://github.com/cloudshift/Data/blob/master/usage/Test.hx
I have first cut of a remote client working, flavor ..
import cloudshift.Core;
using cloudshift.Mixin;
import cloudshift.Data;class TestRemote {
public static function
main() {
Data.store(REMOTESQLITE(“http://localhost:8083/”)).then(function(store) {
store.bucket(“users”).then(function(users) {
users.where(‘blah=”elennena”’).then(function(recs) {
trace(recs.stringify());
});
users.insert({email:”lorena@ritchie.com”,name:”lore”,passwd:”and why not”}).then(function(u) {
trace(u);
});
});
});
}
}This has the same bucket interface as the in-process version (couple of methods throw as not applicable on client).
Works over haXe remoting, and with a tweak to the neko code generator that I’ve already made to my js generator, would be client compatible with neko.
Any serverside bucket can be made available over http - via http async remoting - and security can be added with my session project.
Because proxy async works via haxe.Http I’ve had to modify haxe.Http and add a #if nodejs for requests, but I can ship this in the nodejs haxelib until Nicolas sees fit to recognize Node.js as a first class platform - but don’t hold your breath.
Node complements sqlite very well as being a great single threaded server on a very fast database that prefers non concurrent access. So now you don’t have to do your data access in-process and can spread the load over multiple buckets on multiple servers.
I’ve posted to github, I won’t complete til end of next week as there’s a long weekend here and I haven’t finalised the api.
R
-
lesleeok09 likes this
-
bonham690 likes this
-
skialbainn likes this
-
cloudshift1 posted this