queueobj 15.0.2 → 15.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -51,6 +51,15 @@ npm run test_name_non_matching
51
51
  npm run test_version_matching
52
52
  npm run test_version_non_matching
53
53
  npm run test_http_all
54
+ npm run test_http_top_one
55
+ npm run test_http_bottom_one
56
+ npm run test_http_func_all
57
+ npm run test_http_status_matching
58
+ npm run test_http_status_non_matching
59
+ npm run test_http_name_matching
60
+ npm run test_http_name_non_matching
61
+ npm run test_http_version_matching
62
+ npm run test_http_version_non_matching
54
63
  npm run test_json_http_all
55
64
  npm run test_json_all
56
65
  npm run test_json_top_one
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": {
3
3
  "name": "Jim Manton"
4
4
  },
5
- "version": "15.0.2",
5
+ "version": "15.1.0",
6
6
  "bundleDependencies": [],
7
7
  "dependencies": {
8
8
  "base-queue": "^3.0.1",
@@ -32,6 +32,15 @@
32
32
  "test_version_matching": "node ./tests/version_matching",
33
33
  "test_version_non_matching": "node ./tests/version_non_matching",
34
34
  "test_http_all": "node ./tests/http_all",
35
+ "test_http_top_one": "node ./tests/http_top_one",
36
+ "test_http_bottom_one": "node ./tests/http_bottom_one",
37
+ "test_http_func_all": "node ./tests/http_func_all",
38
+ "test_http_status_matching": "node ./tests/http_status_matching",
39
+ "test_http_status_non_matching": "node ./tests/http_status_non_matching",
40
+ "test_http_name_matching": "node ./tests/http_name_matching",
41
+ "test_http_name_non_matching": "node ./tests/http_name_non_matching",
42
+ "test_http_version_matching": "node ./tests/http_version_matching",
43
+ "test_http_version_non_matching": "node ./tests/http_version_non_matching",
35
44
  "test_json_http_all": "node ./tests/json_http_all",
36
45
  "test_json_all": "node ./tests/json_all",
37
46
  "test_json_top_one": "node ./tests/json_top_one",
package/test/package.js CHANGED
@@ -6,7 +6,7 @@ const packageMock = {
6
6
  "author": {
7
7
  "name": "Jim Manton"
8
8
  },
9
- "version": "15.0.2",
9
+ "version": "15.1.0",
10
10
  "bundleDependencies": [],
11
11
  "dependencies": {
12
12
  "base-queue": "^3.0.1",
@@ -36,6 +36,15 @@ const packageMock = {
36
36
  "test_version_matching": "node ./tests/version_matching",
37
37
  "test_version_non_matching": "node ./tests/version_non_matching",
38
38
  "test_http_all": "node ./tests/http_all",
39
+ "test_http_top_one": "node ./tests/http_top_one",
40
+ "test_http_bottom_one": "node ./tests/http_bottom_one",
41
+ "test_http_func_all": "node ./tests/http_func_all",
42
+ "test_http_status_matching": "node ./tests/http_status_matching",
43
+ "test_http_status_non_matching": "node ./tests/http_status_non_matching",
44
+ "test_http_name_matching": "node ./tests/http_name_matching",
45
+ "test_http_name_non_matching": "node ./tests/http_name_non_matching",
46
+ "test_http_version_matching": "node ./tests/http_version_matching",
47
+ "test_http_version_non_matching": "node ./tests/http_version_non_matching",
39
48
  "test_json_http_all": "node ./tests/json_http_all",
40
49
  "test_json_all": "node ./tests/json_all",
41
50
  "test_json_top_one": "node ./tests/json_top_one",
@@ -72,6 +81,7 @@ const packageMock = {
72
81
  "start": "node app.js"
73
82
  }
74
83
 
84
+
75
85
  describe('package.json', function () {
76
86
  it('should pass', function () {
77
87
  const difference = jsonHasDifferences(packagejson, packageMock)
@@ -0,0 +1,89 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "test_all.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+
9
+ t.process = t.process.bind(t)
10
+ }
11
+
12
+ process(callback) {
13
+ let t = this, fname = "test_all.test1.process"
14
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
15
+ callback({ success: { msg: `processing all test1` } })
16
+ }
17
+ }
18
+
19
+ var tst2 = class test2 {
20
+ constructor(props) {
21
+ let t = this, fname = "test_all.test2.constructor"
22
+ t.log = props.log
23
+ t.id = props.id
24
+
25
+ t.process = t.process.bind(t)
26
+ }
27
+
28
+ process(callback) {
29
+ let t = this, fname = "test_all.test2.process"
30
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
31
+ setTimeout(() => {
32
+ callback({ success: { msg: `processing all test2` } })
33
+ }, 4000)
34
+ }
35
+ }
36
+
37
+ var tst3 = class test3 {
38
+ constructor(props) {
39
+ let t = this, fname = "test_all.test3.constructor"
40
+ t.log = props.log
41
+ t.id = props.id
42
+
43
+ t.process = t.process.bind(t)
44
+ }
45
+
46
+ process(callback) {
47
+ let t = this, fname = "test_all.test3.process"
48
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
49
+ // callback({success: { msg: `processing all test3` }})
50
+ callback({ error: { msg: `there is some problem thrown here on test3` } })
51
+ }
52
+ }
53
+
54
+ var tst4 = class test4 {
55
+ constructor(props) {
56
+ let t = this, fname = "test_all.test4.constructor"
57
+ t.log = props.log
58
+ t.id = props.id
59
+
60
+ t.process = t.process.bind(t)
61
+ }
62
+
63
+ process(callback) {
64
+ let t = this, fname = "test_all.test4.process"
65
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
66
+ callback({ success: { msg: `processing all test4` } })
67
+ }
68
+ }
69
+
70
+ var qObj = new queue()
71
+
72
+ qObj.init().process({
73
+ appender: "bottom_one",
74
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
75
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
76
+ process_objects: [tst1, tst2, tst3, tst4]
77
+ }).then((success) => {
78
+ qObj.logMsg({ msg: `test success: {msg: "all objects processed with no errors"}`.success.italic.bold, type: "success" })
79
+ qObj.log_queue.server()
80
+ }, (error) => {
81
+ if (typeof error == "string") {
82
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
83
+ } else {
84
+ let add_s = (error.error_count > 1) ? 's' : ''
85
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
86
+ }
87
+ qObj.log_queue.server()
88
+ })
89
+
@@ -0,0 +1,97 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "test_all.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+ t.base_queue_process_function = t.custom_function
9
+
10
+ t.custom_function = t.custom_function.bind(t)
11
+ t.base_queue_process_function = t.base_queue_process_function.bind(t)
12
+ }
13
+
14
+ custom_function(callback) {
15
+ let t = this, fname = "test_all.test1.custom_function"
16
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
17
+ callback({ success: { msg: `processing all test1` } })
18
+ }
19
+ }
20
+
21
+ var tst2 = class test2 {
22
+ constructor(props) {
23
+ let t = this, fname = "test_all.test2.constructor"
24
+ t.log = props.log
25
+ t.id = props.id
26
+ t.base_queue_process_function = t.another_function
27
+
28
+ t.another_function = t.another_function.bind(t)
29
+ t.base_queue_process_function = t.base_queue_process_function.bind(t)
30
+ }
31
+
32
+ another_function(callback) {
33
+ let t = this, fname = "test_all.test2.another_function"
34
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
35
+ // callback({ success: { msg: `processing all test2` } })
36
+ setTimeout(() => {
37
+ callback({ success: { msg: `processing all test2` } })
38
+ }, 4000)
39
+ }
40
+ }
41
+
42
+ var tst3 = class test3 {
43
+ constructor(props) {
44
+ let t = this, fname = "test_all.test3.constructor"
45
+ t.log = props.log
46
+ t.id = props.id
47
+ t.base_queue_process_function = t.third_test
48
+
49
+ t.third_test = t.third_test.bind(t)
50
+ t.base_queue_process_function = t.base_queue_process_function.bind(t)
51
+ }
52
+
53
+ third_test(callback) {
54
+ let t = this, fname = "test_all.test3.third_test"
55
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
56
+ // callback({success: { msg: `processing all test3` }})
57
+ callback({ error: { msg: `there is some problem thrown here on test3` } })
58
+ }
59
+ }
60
+
61
+ var tst4 = class test4 {
62
+ constructor(props) {
63
+ let t = this, fname = "test_all.test4.constructor"
64
+ t.log = props.log
65
+ t.id = props.id
66
+ t.base_queue_process_function = t.last_shot
67
+
68
+ t.last_shot = t.last_shot.bind(t)
69
+ t.base_queue_process_function = t.base_queue_process_function.bind(t)
70
+ }
71
+
72
+ last_shot(callback) {
73
+ let t = this, fname = "test_all.test4.process"
74
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
75
+ callback({ success: { msg: `processing all test4` } })
76
+ }
77
+ }
78
+
79
+ var qObj = new queue()
80
+
81
+ qObj.init().process({
82
+ appender: "func_all",
83
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
84
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
85
+ process_objects: [tst1, tst2, tst3, tst4],
86
+ }).then((success) => {
87
+ qObj.logMsg({ msg: `test success: {msg: "http_func_all objects processed with no errors"}`.success.italic.bold, type: "success" })
88
+ qObj.log_queue.server()
89
+ }, (error) => {
90
+ if (typeof error == "string") {
91
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
92
+ } else {
93
+ let add_s = (error.error_count > 1) ? 's' : ''
94
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
95
+ }
96
+ qObj.log_queue.server()
97
+ })
@@ -0,0 +1,93 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "name_matching.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+ t.name = "test 1"
9
+
10
+ t.process = t.process.bind(t)
11
+ }
12
+
13
+ process(callback) {
14
+ let t = this, fname = "name_matching.test1.process"
15
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
16
+ callback({ success: { msg: `processing all ${t.name}` } })
17
+ }
18
+ }
19
+
20
+ var tst2 = class test2 {
21
+ constructor(props) {
22
+ let t = this, fname = "name_matching.test2.constructor"
23
+ t.log = props.log
24
+ t.id = props.id
25
+ t.name = "test 2"
26
+
27
+ t.process = t.process.bind(t)
28
+ }
29
+
30
+ process(callback) {
31
+ let t = this, fname = "name_matching.test2.process"
32
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
33
+ setTimeout(() => {
34
+ callback({ success: { msg: `processing all ${t.name}` } })
35
+ }, 4000)
36
+ }
37
+ }
38
+
39
+ var tst3 = class test3 {
40
+ constructor(props) {
41
+ let t = this, fname = "name_matching.test3.constructor"
42
+ t.log = props.log
43
+ t.id = props.id
44
+ t.name = "test 3"
45
+
46
+ t.process = t.process.bind(t)
47
+ }
48
+
49
+ process(callback) {
50
+ let t = this, fname = "name_matching.test3.process"
51
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
52
+ // callback({success: { msg: `processing all ${t.name}` }})
53
+ callback({ error: { msg: `there is some problem thrown here on ${t.name}` } })
54
+ }
55
+ }
56
+
57
+ var tst4 = class test4 {
58
+ constructor(props) {
59
+ let t = this, fname = "name_matching.test4.constructor"
60
+ t.log = props.log
61
+ t.id = props.id
62
+ t.name = "test 4"
63
+
64
+ t.process = t.process.bind(t)
65
+ }
66
+
67
+ process(callback) {
68
+ let t = this, fname = "name_matching.test4.process"
69
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
70
+ callback({ success: { msg: `processing all ${t.name}` } })
71
+ }
72
+ }
73
+
74
+ var qObj = new queue()
75
+
76
+ qObj.init().process({
77
+ appender: "name",
78
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
79
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
80
+ include_names: ["test 2", "test 4"],
81
+ process_objects: [tst1, tst2, tst3, tst4]
82
+ }).then((success) => {
83
+ qObj.logMsg({ msg: `test success: {msg: "name matching objects processed with no errors"}`.success.italic.bold, type: "success" })
84
+ qObj.log_queue.server()
85
+ }, (error) => {
86
+ if (typeof error == "string") {
87
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
88
+ } else {
89
+ let add_s = (error.error_count > 1) ? 's' : ''
90
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
91
+ }
92
+ qObj.log_queue.server()
93
+ })
@@ -0,0 +1,93 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "name_non_matching.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+ t.name = "test 1"
9
+
10
+ t.process = t.process.bind(t)
11
+ }
12
+
13
+ process(callback) {
14
+ let t = this, fname = "name_non_matching.test1.process"
15
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
16
+ callback({ success: { msg: `processing all ${t.name}` } })
17
+ }
18
+ }
19
+
20
+ var tst2 = class test2 {
21
+ constructor(props) {
22
+ let t = this, fname = "name_non_matching.test2.constructor"
23
+ t.log = props.log
24
+ t.id = props.id
25
+ t.name = "test 2"
26
+
27
+ t.process = t.process.bind(t)
28
+ }
29
+
30
+ process(callback) {
31
+ let t = this, fname = "name_non_matching.test2.process"
32
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
33
+ setTimeout(() => {
34
+ callback({ success: { msg: `processing all ${t.name}` } })
35
+ }, 4000)
36
+ }
37
+ }
38
+
39
+ var tst3 = class test3 {
40
+ constructor(props) {
41
+ let t = this, fname = "name_non_matching.test3.constructor"
42
+ t.log = props.log
43
+ t.id = props.id
44
+ t.name = "test 3"
45
+
46
+ t.process = t.process.bind(t)
47
+ }
48
+
49
+ process(callback) {
50
+ let t = this, fname = "name_non_matching.test3.process"
51
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
52
+ // callback({success: { msg: `processing all ${t.name}` }})
53
+ callback({ error: { msg: `there is some problem thrown here on ${t.name}` } })
54
+ }
55
+ }
56
+
57
+ var tst4 = class test4 {
58
+ constructor(props) {
59
+ let t = this, fname = "name_non_matching.test4.constructor"
60
+ t.log = props.log
61
+ t.id = props.id
62
+ t.name = "test 4"
63
+
64
+ t.process = t.process.bind(t)
65
+ }
66
+
67
+ process(callback) {
68
+ let t = this, fname = "name_non_matching.test4.process"
69
+ t.log({ msg: `This object (${fname}) is id (${t.id}) name (${t.name}). Do stuff here`.bgBrightGreen, type: "info" })
70
+ callback({ success: { msg: `processing all ${t.name}` } })
71
+ }
72
+ }
73
+
74
+ var qObj = new queue()
75
+
76
+ qObj.init().process({
77
+ appender: "name",
78
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
79
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
80
+ exclude_names: ["test 2", "test 4"],
81
+ process_objects: [tst1, tst2, tst3, tst4]
82
+ }).then((success) => {
83
+ qObj.logMsg({ msg: `test success: {msg: "name non matching objects processed with no errors"}`.success.italic.bold, type: "success" })
84
+ qObj.log_queue.server()
85
+ }, (error) => {
86
+ if (typeof error == "string") {
87
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
88
+ } else {
89
+ let add_s = (error.error_count > 1) ? 's' : ''
90
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
91
+ }
92
+ qObj.log_queue.server()
93
+ })
@@ -0,0 +1,93 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "status.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+ t.status = "init"
9
+
10
+ t.process = t.process.bind(t)
11
+ }
12
+
13
+ process(callback) {
14
+ let t = this, fname = "status.test1.process"
15
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
16
+ callback({ success: { msg: `processing all test1` } })
17
+ }
18
+ }
19
+
20
+ var tst2 = class test2 {
21
+ constructor(props) {
22
+ let t = this, fname = "status.test2.constructor"
23
+ t.log = props.log
24
+ t.id = props.id
25
+ t.status = "step 1"
26
+
27
+ t.process = t.process.bind(t)
28
+ }
29
+
30
+ process(callback) {
31
+ let t = this, fname = "status.test2.process"
32
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
33
+ setTimeout(() => {
34
+ callback({ success: { msg: `processing all test2` } })
35
+ }, 4000)
36
+ }
37
+ }
38
+
39
+ var tst3 = class test3 {
40
+ constructor(props) {
41
+ let t = this, fname = "status.test3.constructor"
42
+ t.log = props.log
43
+ t.id = props.id
44
+ t.status = "remove"
45
+
46
+ t.process = t.process.bind(t)
47
+ }
48
+
49
+ process(callback) {
50
+ let t = this, fname = "status.test3.process"
51
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
52
+ // callback({success: { msg: `processing all test3` }})
53
+ callback({ error: { msg: `there is some problem thrown here on test3` } })
54
+ }
55
+ }
56
+
57
+ var tst4 = class test4 {
58
+ constructor(props) {
59
+ let t = this, fname = "status.test4.constructor"
60
+ t.log = props.log
61
+ t.id = props.id
62
+ t.status = "delete"
63
+
64
+ t.process = t.process.bind(t)
65
+ }
66
+
67
+ process(callback) {
68
+ let t = this, fname = "status.test4.process"
69
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
70
+ callback({ success: { msg: `processing all test4` } })
71
+ }
72
+ }
73
+
74
+ var qObj = new queue()
75
+
76
+ qObj.init().process({
77
+ appender: "status",
78
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
79
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
80
+ include_status: ["init", "delete"],
81
+ process_objects: [tst1, tst2, tst3, tst4]
82
+ }).then((success) => {
83
+ qObj.logMsg({ msg: `test success: {msg: "status matching objects processed with no errors"}`.success.italic.bold, type: "success" })
84
+ qObj.log_queue.server()
85
+ }, (error) => {
86
+ if (typeof error == "string") {
87
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
88
+ } else {
89
+ let add_s = (error.error_count > 1) ? 's' : ''
90
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
91
+ }
92
+ qObj.log_queue.server()
93
+ })
@@ -0,0 +1,93 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "status.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+ t.status = "init"
9
+
10
+ t.process = t.process.bind(t)
11
+ }
12
+
13
+ process(callback) {
14
+ let t = this, fname = "status.test1.process"
15
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
16
+ callback({ success: { msg: `processing all test1` } })
17
+ }
18
+ }
19
+
20
+ var tst2 = class test2 {
21
+ constructor(props) {
22
+ let t = this, fname = "status.test2.constructor"
23
+ t.log = props.log
24
+ t.id = props.id
25
+ t.status = "step 1"
26
+
27
+ t.process = t.process.bind(t)
28
+ }
29
+
30
+ process(callback) {
31
+ let t = this, fname = "status.test2.process"
32
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
33
+ setTimeout(() => {
34
+ callback({ success: { msg: `processing all test2` } })
35
+ }, 4000)
36
+ }
37
+ }
38
+
39
+ var tst3 = class test3 {
40
+ constructor(props) {
41
+ let t = this, fname = "status.test3.constructor"
42
+ t.log = props.log
43
+ t.id = props.id
44
+ t.status = "remove"
45
+
46
+ t.process = t.process.bind(t)
47
+ }
48
+
49
+ process(callback) {
50
+ let t = this, fname = "status.test3.process"
51
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
52
+ // callback({success: { msg: `processing all test3` }})
53
+ callback({ error: { msg: `there is some problem thrown here on test3` } })
54
+ }
55
+ }
56
+
57
+ var tst4 = class test4 {
58
+ constructor(props) {
59
+ let t = this, fname = "status.test4.constructor"
60
+ t.log = props.log
61
+ t.id = props.id
62
+ t.status = "delete"
63
+
64
+ t.process = t.process.bind(t)
65
+ }
66
+
67
+ process(callback) {
68
+ let t = this, fname = "status.test4.process"
69
+ t.log({ msg: `This object (${fname}) is id (${t.id}) status (${t.status}). Do stuff here`.bgBrightGreen, type: "info" })
70
+ callback({ success: { msg: `processing all test4` } })
71
+ }
72
+ }
73
+
74
+ var qObj = new queue()
75
+
76
+ qObj.init().process({
77
+ appender: "status",
78
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
79
+ exclude_logMsg: ["debug", "info"], /* example ["debug", "info"] */
80
+ exclude_status: ["delete"],
81
+ process_objects: [tst1, tst2, tst3, tst4]
82
+ }).then((success) => {
83
+ qObj.logMsg({ msg: `test success: {msg: "status matching objects processed with no errors"}`.success.italic.bold, type: "success" })
84
+ qObj.log_queue.server()
85
+ }, (error) => {
86
+ if (typeof error == "string") {
87
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
88
+ } else {
89
+ let add_s = (error.error_count > 1) ? 's' : ''
90
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
91
+ }
92
+ qObj.log_queue.server()
93
+ })
@@ -0,0 +1,89 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "test_all.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+
9
+ t.process = t.process.bind(t)
10
+ }
11
+
12
+ process(callback) {
13
+ let t = this, fname = "test_all.test1.process"
14
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
15
+ callback({ success: { msg: `processing all test1` } })
16
+ }
17
+ }
18
+
19
+ var tst2 = class test2 {
20
+ constructor(props) {
21
+ let t = this, fname = "test_all.test2.constructor"
22
+ t.log = props.log
23
+ t.id = props.id
24
+
25
+ t.process = t.process.bind(t)
26
+ }
27
+
28
+ process(callback) {
29
+ let t = this, fname = "test_all.test2.process"
30
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
31
+ setTimeout(() => {
32
+ callback({ success: { msg: `processing all test2` } })
33
+ }, 4000)
34
+ }
35
+ }
36
+
37
+ var tst3 = class test3 {
38
+ constructor(props) {
39
+ let t = this, fname = "test_all.test3.constructor"
40
+ t.log = props.log
41
+ t.id = props.id
42
+
43
+ t.process = t.process.bind(t)
44
+ }
45
+
46
+ process(callback) {
47
+ let t = this, fname = "test_all.test3.process"
48
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
49
+ // callback({success: { msg: `processing all test3` }})
50
+ callback({ error: { msg: `there is some problem thrown here on test3` } })
51
+ }
52
+ }
53
+
54
+ var tst4 = class test4 {
55
+ constructor(props) {
56
+ let t = this, fname = "test_all.test4.constructor"
57
+ t.log = props.log
58
+ t.id = props.id
59
+
60
+ t.process = t.process.bind(t)
61
+ }
62
+
63
+ process(callback) {
64
+ let t = this, fname = "test_all.test4.process"
65
+ t.log({ msg: `This object (${fname}) is id (${t.id}). Do stuff here`.bgBrightGreen, type: "info" })
66
+ callback({ success: { msg: `processing all test4` } })
67
+ }
68
+ }
69
+
70
+ var qObj = new queue()
71
+
72
+ qObj.init().process({
73
+ appender: "top_one",
74
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
75
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
76
+ process_objects: [tst1, tst2, tst3, tst4]
77
+ }).then((success) => {
78
+ qObj.logMsg({ msg: `test success: {msg: "all objects processed with no errors"}`.success.italic.bold, type: "success" })
79
+ qObj.log_queue.server()
80
+ }, (error) => {
81
+ if (typeof error == "string") {
82
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
83
+ } else {
84
+ let add_s = (error.error_count > 1) ? 's' : ''
85
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
86
+ }
87
+ qObj.log_queue.server()
88
+ })
89
+
@@ -0,0 +1,93 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "version_matching.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+ t.version = "2.00"
9
+
10
+ t.process = t.process.bind(t)
11
+ }
12
+
13
+ process(callback) {
14
+ let t = this, fname = "version_matching.test1.process"
15
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
16
+ callback({ success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` } })
17
+ }
18
+ }
19
+
20
+ var tst2 = class test2 {
21
+ constructor(props) {
22
+ let t = this, fname = "version_matching.test2.constructor"
23
+ t.log = props.log
24
+ t.id = props.id
25
+ t.version = "1.00"
26
+
27
+ t.process = t.process.bind(t)
28
+ }
29
+
30
+ process(callback) {
31
+ let t = this, fname = "version_matching.test2.process"
32
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
33
+ setTimeout(() => {
34
+ callback({ success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` } })
35
+ }, 4000)
36
+ }
37
+ }
38
+
39
+ var tst3 = class test3 {
40
+ constructor(props) {
41
+ let t = this, fname = "version_matching.test3.constructor"
42
+ t.log = props.log
43
+ t.id = props.id
44
+ t.version = "1.00"
45
+
46
+ t.process = t.process.bind(t)
47
+ }
48
+
49
+ process(callback) {
50
+ let t = this, fname = "version_matching.test3.process"
51
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
52
+ // callback({success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` }})
53
+ callback({ error: { msg: `there is some problem thrown here on ${fname}) is id (${t.id}) version (${t.version})` } })
54
+ }
55
+ }
56
+
57
+ var tst4 = class test4 {
58
+ constructor(props) {
59
+ let t = this, fname = "version_matching.test4.constructor"
60
+ t.log = props.log
61
+ t.id = props.id
62
+ t.version = "3.00"
63
+
64
+ t.process = t.process.bind(t)
65
+ }
66
+
67
+ process(callback) {
68
+ let t = this, fname = "version_matching.test4.process"
69
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
70
+ callback({ success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` } })
71
+ }
72
+ }
73
+
74
+ var qObj = new queue()
75
+
76
+ qObj.init().process({
77
+ appender: "version",
78
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
79
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
80
+ include_version: ["1.00", "3.00"],
81
+ process_objects: [tst1, tst2, tst3, tst4]
82
+ }).then((success) => {
83
+ qObj.logMsg({ msg: `test success: {msg: "version_matching objects processed with no errors"}`.success.italic.bold, type: "success" })
84
+ qObj.log_queue.server()
85
+ }, (error) => {
86
+ if (typeof error == "string") {
87
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
88
+ } else {
89
+ let add_s = (error.error_count > 1) ? 's' : ''
90
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
91
+ }
92
+ qObj.log_queue.server()
93
+ })
@@ -0,0 +1,93 @@
1
+ var queue = require("../app.js")
2
+
3
+ var tst1 = class test1 {
4
+ constructor(props) {
5
+ let t = this, fname = "version_non_matching.test1.constructor"
6
+ t.log = props.log
7
+ t.id = props.id
8
+ t.version = "2.00"
9
+
10
+ t.process = t.process.bind(t)
11
+ }
12
+
13
+ process(callback) {
14
+ let t = this, fname = "version_non_matching.test1.process"
15
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
16
+ callback({ success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` } })
17
+ }
18
+ }
19
+
20
+ var tst2 = class test2 {
21
+ constructor(props) {
22
+ let t = this, fname = "version_non_matching.test2.constructor"
23
+ t.log = props.log
24
+ t.id = props.id
25
+ t.version = "1.00"
26
+
27
+ t.process = t.process.bind(t)
28
+ }
29
+
30
+ process(callback) {
31
+ let t = this, fname = "version_non_matching.test2.process"
32
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
33
+ setTimeout(() => {
34
+ callback({ success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` } })
35
+ }, 4000)
36
+ }
37
+ }
38
+
39
+ var tst3 = class test3 {
40
+ constructor(props) {
41
+ let t = this, fname = "version_non_matching.test3.constructor"
42
+ t.log = props.log
43
+ t.id = props.id
44
+ t.version = "1.00"
45
+
46
+ t.process = t.process.bind(t)
47
+ }
48
+
49
+ process(callback) {
50
+ let t = this, fname = "version_non_matching.test3.process"
51
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
52
+ // callback({success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` }})
53
+ callback({ error: { msg: `there is some problem thrown here on ${fname}) is id (${t.id}) version (${t.version})` } })
54
+ }
55
+ }
56
+
57
+ var tst4 = class test4 {
58
+ constructor(props) {
59
+ let t = this, fname = "version_non_matching.test4.constructor"
60
+ t.log = props.log
61
+ t.id = props.id
62
+ t.version = "3.00"
63
+
64
+ t.process = t.process.bind(t)
65
+ }
66
+
67
+ process(callback) {
68
+ let t = this, fname = "version_non_matching.test4.process"
69
+ t.log({ msg: `This object (${fname}) is id (${t.id}) version (${t.version}). Do stuff here`.bgBrightGreen, type: "info" })
70
+ callback({ success: { msg: `processing ${fname}) is id (${t.id}) version (${t.version})` } })
71
+ }
72
+ }
73
+
74
+ var qObj = new queue()
75
+
76
+ qObj.init().process({
77
+ appender: "version",
78
+ xlog: {appender: "http", hostname: "127.0.0.1", port: 3003},
79
+ exclude_logMsg: ["debug"], /* example ["debug", "info"] */
80
+ exclude_version: ["1.00", "3.00"],
81
+ process_objects: [tst1, tst2, tst3, tst4]
82
+ }).then((success) => {
83
+ qObj.logMsg({ msg: `test success: {msg: "version non matching objects processed with no errors"}`.success.italic.bold, type: "success" })
84
+ qObj.log_queue.server()
85
+ }, (error) => {
86
+ if (typeof error == "string") {
87
+ qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
88
+ } else {
89
+ let add_s = (error.error_count > 1) ? 's' : ''
90
+ qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
91
+ }
92
+ qObj.log_queue.server()
93
+ })