file-obj-queue 3.0.0 → 3.0.1
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/.github/workflows/{github-actions.yml → github-actions-demo.yml} +1 -1
- package/.github/workflows/node.js.yml +0 -1
- package/LICENSE +1 -1
- package/README.md +7 -132
- package/app.js +40 -155
- package/base_queue/app.js +146 -0
- package/base_queue/appenders/base.js +77 -0
- package/base_queue/appenders/json_all.js +70 -0
- package/package.json +7 -28
- package/test/app.js +1 -5
- package/test/package.js +7 -28
- package/tests/appenders/all.js +1 -1
- package/tests/appenders/base.js +1 -1
- package/tests/appenders/bottom_one.js +1 -1
- package/tests/appenders/func_all.js +1 -1
- package/tests/appenders/sync.js +1 -1
- package/tests/appenders/sync_all.js +1 -1
- package/tests/appenders/top_one.js +1 -1
- package/tests/appenders/version.js +1 -1
- package/tests/files.js +32 -50
- package/lib/appenders/all.js +0 -17
- package/lib/appenders/base.js +0 -189
- package/lib/appenders/bottom_one.js +0 -17
- package/lib/appenders/func_all.js +0 -17
- package/lib/appenders/name.js +0 -17
- package/lib/appenders/status.js +0 -17
- package/lib/appenders/sync.js +0 -17
- package/lib/appenders/sync_all.js +0 -17
- package/lib/appenders/top_one.js +0 -17
- package/lib/appenders/version.js +0 -17
- package/tests/all.js +0 -85
- package/tests/bottom_one.js +0 -86
- package/tests/func_all.js +0 -94
- package/tests/json_all.js +0 -107
- package/tests/json_bottom_one.js +0 -108
- package/tests/json_func_all.js +0 -109
- package/tests/json_name_matching.js +0 -109
- package/tests/json_name_non_matching.js +0 -109
- package/tests/json_status_matching.js +0 -110
- package/tests/json_status_non_matching.js +0 -110
- package/tests/json_top_one.js +0 -108
- package/tests/json_version_matching.js +0 -110
- package/tests/json_version_non_matching.js +0 -110
- package/tests/name_matching.js +0 -90
- package/tests/name_non_matching.js +0 -90
- package/tests/status_matching.js +0 -90
- package/tests/status_non_matching.js +0 -90
- package/tests/top_one.js +0 -85
- package/tests/version_matching.js +0 -90
- package/tests/version_non_matching.js +0 -90
|
@@ -1,90 +0,0 @@
|
|
|
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
|
-
exclude_logMsg: ["debug"], /* example ["debug", "info"] */
|
|
79
|
-
exclude_version: ["1.00", "3.00"],
|
|
80
|
-
process_objects: [tst1, tst2, tst3, tst4]
|
|
81
|
-
}).then((success) => {
|
|
82
|
-
qObj.logMsg({ msg: `test success: {msg: "version non matching objects processed with no errors"}`.success.italic.bold, type: "success" })
|
|
83
|
-
}, (error) => {
|
|
84
|
-
if (typeof error == "string") {
|
|
85
|
-
qObj.logMsg({ msg: `error: ${error}`.error.italic.bold, type: "error" })
|
|
86
|
-
} else {
|
|
87
|
-
let add_s = (error.error_count > 1) ? 's' : ''
|
|
88
|
-
qObj.logMsg({ msg: `${error.error_count} error${add_s} detected`.error.italic.bold, type: "error" })
|
|
89
|
-
}
|
|
90
|
-
})
|