Comments (5)
nevermind got it working by looking at the hapiger implementation
from ger.
@grahamjenson Actually i can't figure out how to initialize the namespace. I have this so far
'use strict';
var env = process.env.NODE_ENV;
import config from '../local.json';
import g from 'ger';
import ret_esm from 'ger_rethinkdb_esm';
var RethinkDBESM = ret_esm.esm; // rethinkdb event storage manager
var r = ret_esm.r; // rethinkdb ORM
var conn = r({
host: '192.168.99.100',
port: 28015,
db: 'matching'
});
var esm = new RethinkDBESM({r: conn})
var ger = new g.GER(esm);
/**
* Track actions like `bob`, `likes`, `jill` and
**/
export function trackEvent(params, done) {
ger.events([params.event])
.then((event) => {
done(null, params.event);
})
.catch((error) => {
done('Failed to save event: ', params.event);
});
}
/**
* Get recommendations for user and filter
* out user blacklisted ids.
**/
export function getRecommendations(params, done) {
}
from ger.
Got this working by doing something like this
'use strict';
import g from 'ger';
import ret_esm from 'ger_rethinkdb_esm';
var RethinkDBESM = ret_esm.esm; // rethinkdb event storage manager
var r = ret_esm.r; // rethinkdb ORM
class MatchingService {
constructor(config) {
let conn = r(config.connection)
let esm = new RethinkDBESM({r: conn})
let ger = new g.GER(esm, {
logging_options: {
reporters: [{
reporter: require('good-console'),
events: { log: '*', response: '*' }
}]
}
});
// Create namespace if it doesnt exist (db tables)
ger.initialize_namespace(config.namespace)
.then((namespace) => {
console.info(`initialized ${config.namespace}:`, namespace)
})
this._ger = ger;
}
/**
* Track actions like `bob`, `likes`, `jill` and
**/
trackEvent(params, done) {
this._ger.events([params.event])
.then((event) => {
done(null, params.event);
})
.catch((error) => {
done('Failed to save event: ', params.event);
});
}
/**
* Get recommendations for user and filter
* out user blacklisted ids.
**/
getRecommendations(params, done) {
}
}
export default MatchingService
from ger.
Hey, this was awesome. Cheers for contributing :)
Yeah namespaces are just buckets where events live, so one needs to be created before events go into it. I used to check before each event if the namespace exists and if it didnt create it. But this was a massive performance hit for something that would just be a one-off event.
from ger.
Yeah i was confused originally because when i called initialize_namespace
tables weren't being created and i didn't have any errors. I think this was due to my docker containers connecting together since i have a container for rethinkdb and another for our matching service.
Also was a little confused on the ESM
setup and Rethinkdbdash
but it makes sense now. Thanks for putting together the ESM!
from ger.
Related Issues (20)
- Remove duplicate events when bulk adding HOT 1
- Component Model for GER for extensions and ESMs
- Some new changes to recently_actioned_things_by_people breaks some tests in the RethinkdbESM HOT 1
- Minimum history only for supplied actions
- MongoDB / Mongoose ESM HOT 3
- The similarity of items... HOT 1
- Need some help with the API (docs seem outdated) HOT 3
- API for avoiding the cold start problem HOT 1
- What's the reason for setting the action weight on the fly during recommendation? HOT 2
- Finding similar people? HOT 2
- Finding best people for things HOT 2
- easy way to find_events that aren't expired? HOT 2
- License HOT 1
- Delete Person HOT 2
- New feature: event weight decay HOT 2
- get most popular with time decay
- Running GER in AWS Lamba
- Is GER maintained? HOT 4
- Is still working?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ger.