Cleanup test_chat
This commit is contained in:
parent
76acf2cb67
commit
d654195fb8
|
@ -42,17 +42,18 @@ proc readStdin(facet: Facet; ds: Cap; username: string) {.asyncio.} =
|
|||
run(facet, send)
|
||||
|
||||
proc chat(turn: var Turn; ds: Cap; username: string) =
|
||||
during(turn, ds, ?:Present) do (who: string):
|
||||
echo who, " joined"
|
||||
do:
|
||||
echo who, " left"
|
||||
during(turn, ds, ?:Present) do (who: string):
|
||||
echo who, " joined"
|
||||
do:
|
||||
echo who, " left"
|
||||
|
||||
onMessage(turn, ds, ?:Says) do (who: string, what: string):
|
||||
echo who, ": ", what
|
||||
onMessage(turn, ds, ?:Says) do (who: string, what: string):
|
||||
echo who, ": ", what
|
||||
|
||||
discard publish(turn, ds, Present(username: username))
|
||||
discard trampoline:
|
||||
whelp readStdin(turn.facet, ds, username)
|
||||
discard publish(turn, ds, Present(username: username))
|
||||
|
||||
discard trampoline:
|
||||
whelp readStdin(turn.facet, ds, username)
|
||||
|
||||
proc main =
|
||||
var username = ""
|
||||
|
|
Loading…
Reference in New Issue