Browse files

Modified so it can be quickly used with different backend modules.

  • Loading branch information...
1 parent e45f9a7 commit 5c77d1bc0e751e0868df5acee5c5e79348ea3c78 @kusor committed Apr 17, 2012
Showing with 71 additions and 8 deletions.
  1. +2 −1 .gitignore
  2. +14 −2 README.md
  3. +1 −1 api.js
  4. +25 −0 config.pg.json
  5. 0 config.json.sample → config.redis.json
  6. +6 −4 package.json → package-pg.json
  7. +23 −0 package-redis.json
View
3 .gitignore
@@ -8,6 +8,7 @@ docs/*.json
docs/*.html
build
*.log
-*.json
+package.json
+config.json
workflow-indentifier
*.vim
View
16 README.md
@@ -6,7 +6,20 @@ Usage examples for [node-workflow](http://kusor.github.com/node-workflow/).
Pre-requirements:
+These examples can run using any of the supported backend modules for `wf`.
+Example files are provided for these modules.
+
+If you want to run the example using Redis, you need:
+
- Working Redis Server. (Version 2.4.+).
+- Use `config.redis.json` as your configuration file when running the services.
+- Copy the file `package-redis.json` to `package.json`.
+
+If you want to use PostgreSQL:
+
+- Working PostgreSQL 9+ server.
+- Use `config.pg.json` as your configuration file when running the services.
+- Copy the file `package-pg.json` to `package.json`.
# Clone the repo and build the deps:
@@ -30,8 +43,7 @@ or different machines, as far as they have access to Redis Server.
This repository contains everything needed to illustrate:
-- An example config file - `config.json.sample` which should be
- renamed to `config.json` and modified to properly match your local
+- An example config file which should be modified to properly match your local
environment.
Remember that, in order to process any `job` the `workflow-runner` needs
View
2 api.js
@@ -4,7 +4,7 @@
// workflows, queue jobs and obtain the results.
// NOTE it needs `./node_modules/.bin/workflow-api` and
-// `./node_modules/.bin/workflow-runner.js` running
+// `./node_modules/.bin/workflow-runner` running
// before you run this file.
// Call from parent directory with:
View
25 config.pg.json
@@ -0,0 +1,25 @@
+{
+ "backend": {
+ "module": "wf-pg-backend",
+ "opts": {
+ "port": 5432,
+ "host": "localhost",
+ "database": "node_workflow_test",
+ "user": "postgres",
+ "password": "",
+ "test": true
+ }
+ },
+ "api": {
+ "port": 8080
+ },
+ "runner": {
+ "identifier": "cd925eef-93fb-4bfe-a820-2aaedf9fc006",
+ "forks": 10,
+ "run_interval": 6,
+ "sandbox": {
+ "restify": "restify",
+ "uuid": "node-uuid"
+ }
+ }
+}
View
0 config.json.sample → config.redis.json
File renamed without changes.
View
10 package.json → package-pg.json
@@ -1,8 +1,9 @@
{
"author": "Pedro Palazón Candel <kusorbox@gmail.com> (http://www.joyent.com)",
- "name": "wf-example",
+ "name": "wf-pg-example",
"description": "Node Workflow usage examples",
- "version": "0.2.0",
+ "version": "0.2.5",
+ "private": true,
"homepage": "https://github.com/kusor/node-workflow-example",
"repository": {
"type": "git",
@@ -12,10 +13,11 @@
"node": ">=0.6"
},
"dependencies": {
- "wf": "0.2.0",
- "wf-redis-backend": "0.2.0",
+ "wf": "0.2.5",
+ "wf-pg-backend": "0.2.8",
"restify": "1.0.0",
"node-uuid": "1.3.3"
},
"devDependencies": {}
}
+
View
23 package-redis.json
@@ -0,0 +1,23 @@
+{
+ "author": "Pedro Palazón Candel <kusorbox@gmail.com> (http://www.joyent.com)",
+ "name": "wf-redis-example",
+ "description": "Node Workflow usage examples",
+ "version": "0.2.3",
+ "private": true,
+ "homepage": "https://github.com/kusor/node-workflow-example",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/kusor/node-workflow-example.git"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "dependencies": {
+ "wf": "0.2.5",
+ "wf-redis-backend": "0.2.3",
+ "restify": "1.0.0",
+ "node-uuid": "1.3.3"
+ },
+ "devDependencies": {}
+}
+

0 comments on commit 5c77d1b

Please sign in to comment.