2020-05-24 17:32:50 +03:00
|
|
|
:: shoe: example usage of /lib/shoe
|
|
|
|
::
|
2020-05-27 00:45:45 +03:00
|
|
|
:: the app supports one command: "demo".
|
|
|
|
:: running this command renders some text on all sole clients.
|
|
|
|
::
|
2020-05-24 17:32:50 +03:00
|
|
|
/+ shoe, verb, dbug, default-agent
|
|
|
|
|%
|
|
|
|
+$ state-0 [%0 ~]
|
2020-09-01 21:13:48 +03:00
|
|
|
+$ command
|
|
|
|
$? %demo
|
|
|
|
%row
|
|
|
|
%table
|
|
|
|
==
|
2020-05-24 17:32:50 +03:00
|
|
|
::
|
|
|
|
+$ card card:shoe
|
|
|
|
--
|
|
|
|
=| state-0
|
|
|
|
=* state -
|
|
|
|
::
|
|
|
|
%+ verb |
|
|
|
|
%- agent:dbug
|
|
|
|
^- agent:gall
|
|
|
|
%- (agent:shoe command)
|
|
|
|
^- (shoe:shoe command)
|
|
|
|
|_ =bowl:gall
|
|
|
|
+* this .
|
|
|
|
def ~(. (default-agent this %|) bowl)
|
|
|
|
des ~(. (default:shoe this command) bowl)
|
|
|
|
::
|
|
|
|
++ on-init on-init:def
|
|
|
|
++ on-save !>(state)
|
|
|
|
++ on-load
|
|
|
|
|= old=vase
|
|
|
|
^- (quip card _this)
|
|
|
|
[~ this]
|
|
|
|
::
|
|
|
|
++ on-poke on-poke:def
|
|
|
|
++ on-watch on-watch:def
|
|
|
|
++ on-leave on-leave:def
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
++ on-agent on-agent:def
|
|
|
|
++ on-arvo on-arvo:def
|
|
|
|
++ on-fail on-fail:def
|
|
|
|
::
|
|
|
|
++ command-parser
|
sole: properly support multiple sessions
We update the sole protocol to more cleanly support multiple sessions.
Primarily, the "sole id" is updated to be a [@p @ta] instead of a @ta,
and it is now generated based off the connected dill session, rather
than statically.
This change ripples out to applications that support the sole protocol:
the subscription path becomes /sole/[ship]/[session] (as opposed to
/sole/[per-ship-constant]), and %sole-action pokes include the new id as
well.
For shoe agents, this means (at the very least) updating the function
signatures of the shoe arms.
/lib/sole has been updated to include helper functions for parsing a
sole-id from a subscription path, and turning a sole-id into its
corresponding path. It also has a function to aid in migrating old
sole-ids.
Existing sole agents are made to kick any known open sessions, forcing a
resubscribe by drum, so that they may use exclusively the new format
going forward. Third-party agents are recommended to do the same.
Note that some functionality, such as |link, still operates exclusively
on the default session. Improvements in this area to follow soon.
2022-02-21 00:53:53 +03:00
|
|
|
|= =sole-id:shoe
|
2020-06-06 19:58:57 +03:00
|
|
|
^+ |~(nail *(like [? command]))
|
2020-09-01 21:13:48 +03:00
|
|
|
%+ stag &
|
|
|
|
(perk %demo %row %table ~)
|
2020-05-24 17:32:50 +03:00
|
|
|
::
|
|
|
|
++ tab-list
|
sole: properly support multiple sessions
We update the sole protocol to more cleanly support multiple sessions.
Primarily, the "sole id" is updated to be a [@p @ta] instead of a @ta,
and it is now generated based off the connected dill session, rather
than statically.
This change ripples out to applications that support the sole protocol:
the subscription path becomes /sole/[ship]/[session] (as opposed to
/sole/[per-ship-constant]), and %sole-action pokes include the new id as
well.
For shoe agents, this means (at the very least) updating the function
signatures of the shoe arms.
/lib/sole has been updated to include helper functions for parsing a
sole-id from a subscription path, and turning a sole-id into its
corresponding path. It also has a function to aid in migrating old
sole-ids.
Existing sole agents are made to kick any known open sessions, forcing a
resubscribe by drum, so that they may use exclusively the new format
going forward. Third-party agents are recommended to do the same.
Note that some functionality, such as |link, still operates exclusively
on the default session. Improvements in this area to follow soon.
2022-02-21 00:53:53 +03:00
|
|
|
|= =sole-id:shoe
|
2020-05-24 17:32:50 +03:00
|
|
|
^- (list [@t tank])
|
|
|
|
:~ ['demo' leaf+"run example command"]
|
2020-09-01 21:13:48 +03:00
|
|
|
['row' leaf+"print a row"]
|
|
|
|
['table' leaf+"display a table"]
|
2020-05-24 17:32:50 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ on-command
|
sole: properly support multiple sessions
We update the sole protocol to more cleanly support multiple sessions.
Primarily, the "sole id" is updated to be a [@p @ta] instead of a @ta,
and it is now generated based off the connected dill session, rather
than statically.
This change ripples out to applications that support the sole protocol:
the subscription path becomes /sole/[ship]/[session] (as opposed to
/sole/[per-ship-constant]), and %sole-action pokes include the new id as
well.
For shoe agents, this means (at the very least) updating the function
signatures of the shoe arms.
/lib/sole has been updated to include helper functions for parsing a
sole-id from a subscription path, and turning a sole-id into its
corresponding path. It also has a function to aid in migrating old
sole-ids.
Existing sole agents are made to kick any known open sessions, forcing a
resubscribe by drum, so that they may use exclusively the new format
going forward. Third-party agents are recommended to do the same.
Note that some functionality, such as |link, still operates exclusively
on the default session. Improvements in this area to follow soon.
2022-02-21 00:53:53 +03:00
|
|
|
|= [=sole-id:shoe =command]
|
2020-05-24 17:32:50 +03:00
|
|
|
^- (quip card _this)
|
2020-09-01 21:13:48 +03:00
|
|
|
=; [to=(list _sole-id) fec=shoe-effect:shoe]
|
|
|
|
[[%shoe to fec]~ this]
|
|
|
|
?- command
|
|
|
|
%demo
|
|
|
|
:- ~
|
|
|
|
:- %sole
|
|
|
|
=/ =tape "{(scow %p src.bowl)} ran the command"
|
|
|
|
?. =(src our):bowl
|
|
|
|
[%txt tape]
|
|
|
|
[%klr [[`%br ~ `%g] [(crip tape)]~]~]
|
|
|
|
::
|
|
|
|
%row
|
|
|
|
:- [sole-id]~
|
|
|
|
:+ %row
|
|
|
|
~[8 27 35 5]
|
|
|
|
~[p+src.bowl da+now.bowl t+'plenty room here!' t+'less here!']
|
|
|
|
::
|
|
|
|
%table
|
|
|
|
:- [sole-id]~
|
|
|
|
:^ %table
|
|
|
|
~[t+'ship' t+'date' t+'long text' t+'tldr']
|
|
|
|
~[8 27 35 5]
|
|
|
|
:~ ~[p+src.bowl da+now.bowl t+'plenty room here!' t+'less here!']
|
|
|
|
~[p+~marzod t+'yesterday' t+'sometimes:\0anewlines' t+'newlines']
|
|
|
|
==
|
|
|
|
==
|
2020-05-24 17:32:50 +03:00
|
|
|
::
|
|
|
|
++ can-connect
|
sole: properly support multiple sessions
We update the sole protocol to more cleanly support multiple sessions.
Primarily, the "sole id" is updated to be a [@p @ta] instead of a @ta,
and it is now generated based off the connected dill session, rather
than statically.
This change ripples out to applications that support the sole protocol:
the subscription path becomes /sole/[ship]/[session] (as opposed to
/sole/[per-ship-constant]), and %sole-action pokes include the new id as
well.
For shoe agents, this means (at the very least) updating the function
signatures of the shoe arms.
/lib/sole has been updated to include helper functions for parsing a
sole-id from a subscription path, and turning a sole-id into its
corresponding path. It also has a function to aid in migrating old
sole-ids.
Existing sole agents are made to kick any known open sessions, forcing a
resubscribe by drum, so that they may use exclusively the new format
going forward. Third-party agents are recommended to do the same.
Note that some functionality, such as |link, still operates exclusively
on the default session. Improvements in this area to follow soon.
2022-02-21 00:53:53 +03:00
|
|
|
|= =sole-id:shoe
|
2020-05-24 17:32:50 +03:00
|
|
|
^- ?
|
|
|
|
?| =(~zod src.bowl)
|
|
|
|
(team:title [our src]:bowl)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ on-connect on-connect:des
|
|
|
|
++ on-disconnect on-disconnect:des
|
|
|
|
--
|