-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatcher.coffee
executable file
·54 lines (46 loc) · 1.32 KB
/
matcher.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env coffee
###
This is a refenrece implementation of a simple string matching algorithm
using nodejs/coffee-script. This is not about a fast implementation of
string matching but more a proof of concept for scalable and high-available
string matching using a scalable and high-available database
- Apache Cassandra -
###
broadway = require 'broadway'
app = new broadway.App()
##
# Configure my app
##
app.config.argv
t:
alias: 'container',
demand: true,
describe: 'the container class used [possible: MemoryContainer]'
c:
alias: 'config',
demand: true,
describe: '/path/to/config/json'
app.config.file
file: app.config.get 'config'
##
# Add the plugins
##
app.use require './lib/plugins/Logging'
app.use require './lib/plugins/StatsdClient'
app.use require './lib/plugins/MemoryMeasure'
app.use require './lib/plugins/EventReader'
app.use require './lib/plugins/Container'
app.use require './lib/plugins/Matcher'
app.use require './lib/plugins/OutputHandler'
# app.matcher.on 'end', ->
# app.remove 'memoryMeasure'
# app.remove 'statsd'
# app.remove 'container'
process.on 'SIGINT', ->
app.remove 'memoryMeasure'
app.remove 'statsd'
app.remove 'eventReader'
app.remove 'container'
setTimeout (-> process.exit 1), 1000
app.init (err) ->
throw err if err?