is there an event thrown when server is actually s...
# ktor
c
is there an event thrown when server is actually started?
s
c
that looks good
I want to suspend until it's started so I guess I could use the started event to signal a deferred completable
or is there another mechanism?
i want to start the netty engine with wait=false and then suspend until it actually is ready
apparently this works only when I subscribe once my module has been called
not when I am outside waiting for server to start
if I subscribe before starting it throws illegal exception saying monitor didn't start
and if I subscribe after starting with false
it does never trigger
this defeats a bit the purpose of this IMO
I am using ApplicationStarted
s
Maybe you should report that. In any case, working with ktor from outside a module isnt very nice if at all possible. I have tried myself but ended up embedding everything into my ktor module (which I think I want anyways to get reloading of everything)
c
doesn't make much sense, works only if I call subscribe from within the module
c
Can’t you pass something into the module (for example, a
CompletableDeferred
that could be resolved then by a monitor event handler)?
s
Isnt the only way to pass something in via the config ?
c
i was thinking to pass somehow something
trying to figure it out
can't figure out anything else other than using a static deferred completable which is kind of global
c
Yeah, this doesn’t look perfect
Why do you need to do it outside?
c
i want to make sure server is started before i run my tests
something like this
and i don't want to block the whole suite if I pass true
i am using testNG
e
Wait, why aren’t you just using the Ktor test engine to run your tests?