Split out experimental "stream" protocols; make tcp.rkt use them; more inertness checks

Also, a few other important changes:
 - Better printing of entity-ref structs
 - Inertness checks on assertion retraction (!) and preventer-disarm
 - Correct selection of active facet during dataflow recomputations
 - Repair silly omission in turn-assert/dataflow!
This commit is contained in:
Tony Garnock-Jones 2021-06-16 21:41:53 +02:00
parent a73b6a9f4a
commit b6bc816daf
2 changed files with 46 additions and 21 deletions

43
stream.prs Normal file
View File

@ -0,0 +1,43 @@
version 1 .
embeddedType EntityRef.Ref .
StreamConnection = <stream-connection @source #!Source @sink #!Sink @spec any>.
; Assertion
StreamListener = <stream-listener @spec any @handle #!ConnectionHandler>.
; Assertion
StreamConnect = <stream-connect @spec any @handle #!ConnectionHandler>.
; Assertion
ConnectionHandler =
/ @connected <stream-connected @source #!Source @sink #!Sink>
/ @rejected <stream-rejected @message string>
.
; Assertion
StreamError = <error @message string>.
Source =
; Assertions:
/ <sink @controller #!Sink>
/ StreamError
; Messages:
/ <credit @amount CreditAmount @mode Mode>
.
Sink =
; Assertions:
/ <source @controller #!Source>
/ StreamError
; Messages:
/ <data @payload any @mode Mode>
/ <eof>
.
CreditAmount = @count int / @unbounded =unbounded .
Mode = =bytes / @lines LineMode / <packet @size int> / <object @description any>.
LineMode = =lf / =crlf .

24
tcp.prs
View File

@ -1,25 +1,7 @@
version 1 .
embeddedType EntityRef.Ref .
Connection = <connection @handle #!ActiveSocket @spec any>.
ConnectionPeer = <connection-peer @handle #!ActiveSocket @spec any>.
TcpRemote = <tcp-remote @host string @port int>.
TcpLocal = <tcp-local @host string @port int>.
TcpRemote = <remote @host string @port int>.
TcpLocal = <local @host string @port int>.
ActiveSocket =
/ <controller @controller #!Sink>
/ <close @message string>
/ Socket
.
Socket =
/ <credit @amount CreditAmount @mode Mode>
/ <data @payload bytes @mode Mode>
/ <eof>
.
CreditAmount = @count int / @unbounded =unbounded .
Mode = =bytes / @lines LineMode / <packet @size int>.
LineMode = =lf / =crlf .
TcpPeerInfo = <tcp-peer @handle #!any @local TcpLocal @remote TcpRemote>.