mojotech / modernator-haskell

An API server for hosting Reddit AMA style Q&A sessions.
GNU General Public License v3.0
4 stars 0 forks source link

Extend servant-mock to cover the Websocket endpoint #14

Open RocketPuppy opened 8 years ago

RocketPuppy commented 8 years ago

I'm not sure what the right approach is yet here. It might be to just send arbitrary messages along the socket at some fixed (or random, bounded) interval. Check out http://hackage.haskell.org/package/servant-mock-0.7/docs/src/Servant-Mock.html#line-157 for inspiration (code below)

instance HasMock Raw context where
  mock _ _ = \_req respond -> do
    bdy <- genBody
    respond $ responseLBS status200 [] bdy