Yet more documentation.
This commit is contained in:
parent
628cf190f6
commit
0b0aabfbfd
|
@ -2,8 +2,21 @@
|
||||||
@require[racket/include]
|
@require[racket/include]
|
||||||
@include{prelude.inc}
|
@include{prelude.inc}
|
||||||
|
|
||||||
|
@require[(for-label (except-in "../sugar-untyped.rkt"
|
||||||
|
transition/no-state)
|
||||||
|
(only-in "../drivers/tcp-bare.rkt" tcp)
|
||||||
|
(except-in "../sugar-typed.rkt"
|
||||||
|
?))]
|
||||||
|
|
||||||
@title[#:tag "high-level-interface"]{High-level interface}
|
@title[#:tag "high-level-interface"]{High-level interface}
|
||||||
|
|
||||||
|
This high-level interface between a VM and a process is analogous to
|
||||||
|
the @emph{C library interface} of a Unix-like operating system. The
|
||||||
|
@secref{low-level-interface} corresponds to the @emph{system call
|
||||||
|
interface} of a Unix-like operating system.
|
||||||
|
|
||||||
|
@section{Using @tt{#lang marketplace} and friends}
|
||||||
|
|
||||||
@defmodulelang*[(marketplace
|
@defmodulelang*[(marketplace
|
||||||
marketplace/flow-control
|
marketplace/flow-control
|
||||||
marketplace/typed
|
marketplace/typed
|
||||||
|
@ -36,11 +49,6 @@ There are a handful of variant languages to choose from:
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
This high-level interface between a VM and a process is analogous to
|
|
||||||
the @emph{C library interface} of a Unix-like operating system. The
|
|
||||||
@secref{low-level-interface} corresponds to the @emph{system call
|
|
||||||
interface} of a Unix-like operating system.
|
|
||||||
|
|
||||||
@section{Using Marketplace as a library}
|
@section{Using Marketplace as a library}
|
||||||
|
|
||||||
@defmodule*[(marketplace/sugar-untyped
|
@defmodule*[(marketplace/sugar-untyped
|
||||||
|
@ -90,10 +98,12 @@ its state type).
|
||||||
|
|
||||||
@section{Constructing topics and roles}
|
@section{Constructing topics and roles}
|
||||||
|
|
||||||
**** ?
|
As previously mentioned, @tech{topics} are ordinary Racket values
|
||||||
**** Role
|
which may have embedded wildcards. The identifier @racket[?] produces
|
||||||
**** Orientation
|
a fresh wildcard value for use in topic patterns.
|
||||||
**** InterestType
|
|
||||||
|
For example,
|
||||||
|
TODO
|
||||||
|
|
||||||
@section{Constructing transitions}
|
@section{Constructing transitions}
|
||||||
**** transition, transition:, transition/no-state
|
**** transition, transition:, transition/no-state
|
||||||
|
|
|
@ -41,6 +41,48 @@ Typed Racket types capturing various notions of handler function.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@section{Topics and Roles}
|
||||||
|
|
||||||
|
@deftype[Topic Any]{
|
||||||
|
|
||||||
|
As previously mentioned, @tech{topics} are ordinary Racket values
|
||||||
|
which may have embedded wildcards.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@defthing[? Topic]{
|
||||||
|
|
||||||
|
Each time @racket[?] is used in an expression context, it produces a
|
||||||
|
fresh topic wildcard, suitable for use in a topic pattern.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@deftogether[(
|
||||||
|
@defstruct*[role ([orientation Orientation] [topic Topic] [interest-type InterestType]) #:prefab]
|
||||||
|
@deftype[Role role]
|
||||||
|
)]{
|
||||||
|
|
||||||
|
Roles are almost always constructed by the
|
||||||
|
@racket[endpoint]/@racket[endpoint:] macros or by the VM
|
||||||
|
implementations themselves. User programs generally only need to
|
||||||
|
destructure @racket[role] instances.
|
||||||
|
|
||||||
|
TODO: Role
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@deftype[Orientation (U 'publisher 'subscriber)]{
|
||||||
|
|
||||||
|
TODO: Orientation
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@deftype[InterestType (U 'participant 'observer 'everything)]{
|
||||||
|
|
||||||
|
TODO: InterestType
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@section{Endpoint Events}
|
@section{Endpoint Events}
|
||||||
|
|
||||||
@deftogether[(
|
@deftogether[(
|
||||||
|
@ -209,11 +251,11 @@ approach.
|
||||||
@deftype[Quit quit]
|
@deftype[Quit quit]
|
||||||
)]{
|
)]{
|
||||||
|
|
||||||
Kills a sibling.@note{Or, if @racket[at-meta-level], a sibling of the
|
Kills a sibling process.@note{Or, if @racket[at-meta-level], a sibling
|
||||||
containing VM.} If @racket[quit-pid] is @racket[#f], kills the current
|
process of the containing VM.} If @racket[quit-pid] is @racket[#f],
|
||||||
process; otherwise, kills the process with the given PID. The
|
kills the current process; otherwise, kills the process with the given
|
||||||
@racket[quit-reason] is passed on to peers of currently-active
|
PID. The @racket[quit-reason] is passed on to peers of
|
||||||
endpoints in the process to be killed, as part of a
|
currently-active endpoints in the process to be killed, as part of a
|
||||||
@racket[absence-event], just as if each active endpoint were deleted
|
@racket[absence-event], just as if each active endpoint were deleted
|
||||||
manually before the process exited.
|
manually before the process exited.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue