~singpolyma/cheogram-smtp

5ae8ddbcddada633ca873de0d7541d20256732a2 — Stephen Paul Weber 2 years ago f692a1c
Run each route handle in new thread

So the handler can block or be slow without hosing processing of
incoming stanzas.
1 files changed, 1 insertions(+), 1 deletions(-)

M Router.hs
M Router.hs => Router.hs +1 -1
@@ 11,7 11,7 @@ runRoutedComponent server secret =
	ExceptT . XMPP.runComponent server secret . runRouted

runRouted :: Routes -> XMPP.XMPP ()
runRouted routes = forever $ XMPP.getStanza >>= handle
runRouted routes = forever $ XMPP.getStanza >>= (void . forkXMPP . handle)
	where
	handle (XMPP.ReceivedIQ iq@XMPP.IQ { XMPP.iqType = XMPP.IQGet }) =
		iqGetRoute routes iq