-
Notifications
You must be signed in to change notification settings - Fork 10
/
function.om
39 lines (31 loc) · 1.29 KB
/
function.om
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
| root hostname mongoPort omPool smscPool port server smscDatabaseName omDatabaseName |
hostname := 'localhost'.
self optionAt: 'db-host' ifPresent: [:dbHost |
hostname := dbHost].
mongoPort := 27017.
self optionAt: 'db-port' ifPresent: [:mongoPortString |
mongoPort := mongoPortString asNumber].
port := 1700.
self optionAt: 'rest-port' ifPresent: [:portString |
port := portString 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.
"The database connection for "
omPool := VOMongoSessionPool host: hostname port: mongoPort database: omDatabaseName username: nil password: nil.
omPool size: 20.
smscPool := VOMongoSessionPool host: hostname port: mongoPort database: smscDatabaseName username: nil password: nil.
smscPool size: 10.
"Start the REST server"
server := ZnServer startOn: port.
server delegate: (ZnJSONRestServerDelegate new
uriSpace: (ShortMessageCenterRestUriSpace new
smscDatabasePool: smscPool;
omDatabasePool: omPool;
yourself);
yourself).