From cb59598e9b49f902de306f8bdb6c0a110a4c658e Mon Sep 17 00:00:00 2001 From: TAGOMORI Satoshi Date: Tue, 7 Jan 2014 19:48:19 +0900 Subject: [PATCH] add notes for refactoring of engine interface --- lib/shib/engines/dummyengine.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/shib/engines/dummyengine.js b/lib/shib/engines/dummyengine.js index 187ff34..7cf6add 100644 --- a/lib/shib/engines/dummyengine.js +++ b/lib/shib/engines/dummyengine.js @@ -10,10 +10,24 @@ Executer.prototype.setup = function(setups, callback){ callback(null); }; -Executer.prototype.execute = function(query, callback){ +Executer.prototype.execute = function(jobname, query, callback){ //TODO: jobname -> queryid ( jobname generation should be done in each engines) callback(null, new Fetcher()); }; +/* + * Fetcher + * + * schema(callback): callback(err, schema) + * schema: {fieldSchemas: ['fieldname1', 'fieldname2', 'fieldname3', ...]} + * //?? schema: ['fieldname1', 'fieldname2', ...] + * + * fetch(num, callback): callback(err, rows, cb) + * num: rows to fetch (null == all) + * rows: ["_col1value_\t_col2value_\t_col3value_", "_col1value_\t_col2value_\t_col3value_", ...] + * no more rows exists if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1)) + * cb: callback function to call after iterative callback process + */ + Executer.prototype.end = function(){}; var Monitor = exports.Monitor = function(){