-
Notifications
You must be signed in to change notification settings - Fork 10
/
function.inserter
32 lines (25 loc) · 1.04 KB
/
function.inserter
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
| hostname mongoPort omPool smscPool inserter smscDatabaseName omDatabaseName |
hostname := 'localhost'.
self optionAt: 'db-host' ifPresent: [:dbHost |
hostname := dbHost].
mongoPort := 27017.
self optionAt: 'db-port' ifPresent: [:mongoPortString |
mongoPort := mongoPortString asNumber].
smscDatabaseName := 'smsc'.
self optionAt: 'smscdb-name' ifPresent: [:name |
smscDatabaseName := name].
omDatabaseName := 'smscOM'.
self optionAt: 'omdb-name' ifPresent: [:name |
omDatabaseName := name].
"Allow to have many Sockets and such"
Smalltalk vm maxExternalSemaphoresSilently: 512.
omPool := VOMongoSessionPool host: hostname port: mongoPort database: omDatabaseName username: nil password: nil.
omPool size: 2.
smscPool := VOMongoSessionPool host: hostname port: mongoPort database: smscDatabaseName username: nil password: nil.
smscPool size: 30.
"Start the inserter"
inserter := ShortMessageCenterInserter new
smscDatabasePool: smscPool;
omDatabasePool: omPool;
yourself.
inserter start.