Osmocore: Move the poll to a new function and call it from the process
This commit is contained in:
parent
de142cc23c
commit
6971bcc78d
18
OsmoCore.st
18
OsmoCore.st
|
@ -16,16 +16,21 @@ Object subclass: OSMOCore [
|
|||
ObjectMemory addDependent: self.
|
||||
]
|
||||
|
||||
OSMOCore class >> poll [
|
||||
| delay |
|
||||
delay := Delay forMilliseconds: 50.
|
||||
|
||||
[true] whileTrue: [
|
||||
self bsc_select_main: 1.
|
||||
delay wait.
|
||||
].
|
||||
]
|
||||
|
||||
OSMOCore class >> startProcess [
|
||||
"I start a new polling process"
|
||||
| delay |
|
||||
delay := Delay forMilliseconds: 500.
|
||||
|
||||
Process := [
|
||||
[true] whileTrue: [
|
||||
self bsc_select_main: 1.
|
||||
" delay wait."
|
||||
].
|
||||
self poll.
|
||||
] fork.
|
||||
]
|
||||
|
||||
|
@ -51,5 +56,4 @@ Object subclass: OSMOCore [
|
|||
|
||||
Eval [
|
||||
OSMOCore initialize.
|
||||
OSMOCore startProcess
|
||||
]
|
||||
|
|
Reference in New Issue