Running webserver from another thread

17 views
Skip to first unread message

David Frese

unread,
Jan 31, 2017, 8:30:02 AM1/31/17
to Immutant
Hello everybody,

The api docs for immutant.web/run states at the very end, that:

`all invocations of 
runmust be within the initialization function for your application, i.e. your -main.`

What's bad if I run it from another thread? (can't see immediate problems if I do)

Thanks,
David

Toby Crawley

unread,
Jan 31, 2017, 8:38:32 AM1/31/17
to David Frese, Immutant
David:

That sentence only applies when running inside WildFly. When inside
WildFly, we invoke your -main from within a ServletContextListener in
order to be able to dynamically register a Servlet for each
immutant.web/run invocation. If you call immutant.web/run in a
different thread, the ServletContext won't be available, and we can't
register the handler as a Servlet. If you aren't using WildFly and
have no intention of using it in the future, you can ignore this
caveat.

- Toby
> --
> You received this message because you are subscribed to the Google Groups
> "Immutant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to immutant+u...@googlegroups.com.
> To post to this group, send email to immu...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/immutant/2fa92327-6321-4030-ae83-c2deb00d81db%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David Frese

unread,
Jan 31, 2017, 9:29:07 AM1/31/17
to Immutant, dfr...@dfrese.de
Thanks, and yes, I'm using it only as a webserver within a larger application where it would be difficult to start it from main.
Reply all
Reply to author
Forward
0 new messages