sole: add %bye effect for closing the session

This lets applications suggest to the client that they should gracefully
unsubscribe from the session.

Arguably this might be accomplished by %kick-ing the client and then
crashing on their subsequent resubscribe, but this requires tracking
their sole session id and has less semantic clarity on what's happening.
This commit is contained in:
fang 2020-12-15 16:56:47 +01:00
parent a124c747b7
commit f285c7954e
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
3 changed files with 3 additions and 1 deletions

View File

@ -793,6 +793,7 @@
?- fec
[%bel *] ta-bel
[%blk *] +>
[%bye *] +>(..ta (se-klin gyl))
[%clr *] +>(..ta (se-blit fec))
[%det *] (ta-got +.fec)
[%err *] (ta-err p.fec)

View File

@ -75,7 +75,7 @@
info+(tape ~(ram re tank))
==
::
?(%bel %clr %nex)
?(%bel %clr %nex %bye)
(frond %act %s -.sef)
==
--

View File

@ -30,6 +30,7 @@
+$ sole-effect :: app to sole
$% [%bel ~] :: beep
[%blk p=@ud q=@c] :: blink+match char at
[%bye ~] :: close session
[%clr ~] :: clear screen
[%det sole-change] :: edit command
[%err p=@ud] :: error point