<html><head><metahttp-equiv="content-type"content="text/html; charset=utf-8"/><title>3 Low-level interface</title><linkrel="stylesheet"type="text/css"href="scribble.css"title="default"/><linkrel="stylesheet"type="text/css"href="racket.css"title="default"/><linkrel="stylesheet"type="text/css"href="footnote.css"title="default"/><linkrel="stylesheet"type="text/css"href="manual-style.css"title="default"/><linkrel="stylesheet"type="text/css"href="manual-racket.css"title="default"/><scripttype="text/javascript"src="scribble-common.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><bodyid="scribble-racket-lang-org"><divclass="tocset"><divclass="tocview"><divclass="tocviewlist tocviewlisttopspace"><divclass="tocviewtitle"><tablecellspacing="0"cellpadding="0"><tr><tdstyle="width: 1em;"><ahref="javascript:void(0);"title="Expand/Collapse"class="tocviewtoggle"onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><ahref="index.html"class="tocviewlink"data-pltdoc="x">Marketplace:<spanclass="mywbr"> </span> Network-<wbr></wbr>Aware Programming</a></td></tr></table></div><divclass="tocviewsublisttop"style="display: block;"id="tocview_0"><tablecellspacing="0"cellpadding="0"><tr><tdalign="right">1 </td><td><ahref="Concepts.html"class="tocviewlink"data-pltdoc="x">Concepts</a></td></tr><tr><tdalign="right">2 </td><td><ahref="high-level-interface.html"class="tocviewlink"data-pltdoc="x">High-<wbr></wbr>level interface</a></td></tr><tr><tdalign="right">3 </td><td><ahref="low-level-interface.html"class="tocviewselflink"data-pltdoc="x">Low-<wbr></wbr>level interface</a></td></tr><tr><tdalign="right">4 </td><td><ahref="Drivers.html"class="tocviewlink"data-pltdoc="x">Drivers</a></td></tr><tr><tdalign="right">5 </td><td><ahref="Management_and_Monitoring.html"class="tocviewlink"data-pltdoc="x">Management and Monitoring</a></td></tr><tr><tdalign="right">6 </td><td><ahref="Examples.html"class="tocviewlink"data-pltdoc="x">Examples</a></td></tr></table></div></div><divclass="tocviewlist"><tablecellspacing="0"cellpadding="0"><tr><tdstyle="width: 1em;"><ahref="javascript:void(0);"title="Expand/Collapse"class="tocviewtoggle"onclick="TocviewToggle(this,"tocview_1");">►</a></td><td>3 </td><td><ahref="low-level-interface.html"class="tocviewselflink"data-pltdoc="x">Low-<wbr></wbr>level interface</a></td></tr></table><divclass="tocviewsublistbottom"style="display: none;"id="tocview_1"><tablecellspacing="0"cellpadding="0"><tr><tdalign="right">3.1 </td><td><ahref="low-level-interface.html#%28part._handler-functions%29"class="tocviewlink"data-pltdoc="x">Handler Functions</a></td></tr><tr><tdalign="right">3.2 </td><td><ahref="low-level-interface.html#%28part._.Messages__.Topics_and_.Roles%29"class="tocviewlink"data-pltdoc="x">Messages, Topics and Roles</a></td></tr><tr><tdalign="right">3.3 </td><td><ahref="low-level-interface.html#%28part._endpoint-events%29"class="tocviewlink"data-pltdoc="x">Endpoint Events</a></td></tr><tr><tdalign="right">3.4 </td><td><ahref="low-level-interface.html#%28part._.Actions%29"class="tocviewlink"data-pltdoc="x">Actions</a></td></tr></table></div></div></div><divclass="tocsub"><divclass="tocsubtitle">On this page:</div><tableclass="tocsublist"cellspacing="0"><tr><td><spanclass="tocsublinknumber">3.1<tt> </tt></span><ahref="#%28part._handler-functions%29"class="tocsubseclink"data-pltdoc="x">Handler Functions</a></td></tr><tr><td><ahref="#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Handler%29%29"class="tocsubnonseclink"data-pltdoc="x"><spanclass="RktSym"><spanclass="RktValLink">Handler</span></span></a></td></tr><tr><td><ahref="#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Trap.K%29%29"class="tocsubnonseclink"data-pltdoc="x"><spanclass="RktSym"><spanclass="RktValLink">Trap<spanclass="mywbr"> </span>K</span></span></a></td></tr><tr><td>
containing <ahref="Concepts.html#%28tech._vm%29"class="techoutside"data-pltdoc="x"><spanclass="techinside">VM</span></a> is based on <ahref="low-level-interface.html#%28tech._handler._function%29"class="techoutside"data-pltdoc="x"><spanclass="techinside">handler functions</span></a> exchanging
<ahref="Concepts.html#%28tech._event%29"class="techoutside"data-pltdoc="x"><spanclass="techinside">event</span></a> and <ahref="Concepts.html#%28tech._action%29"class="techoutside"data-pltdoc="x"><spanclass="techinside">action</span></a> structures with the VM. Both events and
actions are simple Racket structures.</p><p>This low-level interface between a VM and a process is analogous to
the <spanstyle="font-style: italic">system call interface</span> of a Unix-like operating system. The
<ahref="high-level-interface.html"data-pltdoc="x">High-level interface</a> corresponds to the <spanstyle="font-style: italic">C library
interface</span> of a Unix-like operating system.</p><h4>3.1<tt> </tt><aname="(part._handler-functions)"></a>Handler Functions</h4><p>Each <aname="(tech._handler._function)"></a><spanstyle="font-style: italic">handler function</span> is always associated with a particular
<ahref="Concepts.html#%28tech._endpoint%29"class="techoutside"data-pltdoc="x"><spanclass="techinside">endpoint</span></a>, registered with the VM via
<spanclass="RktSym">endpoint</span>/<spanclass="RktSym">endpoint:</span>/<spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._add-endpoint%29%29"class="RktValLink"data-pltdoc="x">add-endpoint</a></span>. A handler
function for a given process with state type <spanclass="RktSym">State</span> has type:</p><blockquoteclass="SCodeFlow"><p><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Endpoint.Event%29%29"class="RktValLink"data-pltdoc="x">EndpointEvent</a></span><spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._-~3e%29%29"class="RktStxLink"data-pltdoc="x"><spanclass="nobreak">-></span></a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._-~3e%29%29"class="RktStxLink"data-pltdoc="x"><spanclass="nobreak">-></span></a></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Transition%29%29"class="RktValLink"data-pltdoc="x">Transition</a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="RktPn">)</span></p></blockquote><p>That is, given an <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Endpoint.Event%29%29"class="RktValLink"data-pltdoc="x">EndpointEvent</a></span> followed by the process’s
current state, the handler should reply with a <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Transition%29%29"class="RktValLink"data-pltdoc="x">Transition</a></span>
containing a new process state and a collection of <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Action%29%29"class="RktValLink"data-pltdoc="x">Action</a></span>s.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><tablecellspacing="0"class="argcontract RForeground"><tr><td><aname="(def._((lib._marketplace/main..rkt)._.Handler))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Handler%29%29"class="RktValDef RktValLink"data-pltdoc="x">Handler</a></span></span></td><td><spanclass="hspace"> </span>:<spanclass="hspace"> </span></td><td><tablecellspacing="0"class="RktBlk"><tr><td><spanclass="RktPn">(</span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.All%29%29"class="RktStxLink"data-pltdoc="x">All</a></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Trap.K%29%29"class="RktValLink"data-pltdoc="x">TrapK</a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="RktPn">)</span></td></tr></table></td></tr></table></blockquote></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><tablecellspacing="0"class="argcontract RForeground"><tr><td><aname="(def._((lib._marketplace/main..rkt)._.Trap.K))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Trap.K%29%29"class="RktValDef RktValLink"data-pltdoc="x">TrapK</a></span></span></td><td><spanclass="hspace"> </span>:<spanclass="hspace"> </span></td><td><tablecellspacing="0"class="RktBlk"><tr><td><spanclass="RktPn">(</span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.All%29%29"class="RktStxLink"data-pltdoc="x">All</a></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Endpoint.Event%29%29"class="RktValLink"data-pltdoc="x">EndpointEvent</a></span><spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._-~3e%29%29"class="RktStxLink"data-pltdoc="x"><spanclass="nobreak">-></span></a></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Interrupt.K%29%29"class="RktVal
and <ahref="Concepts.html#%28tech._topic%29"class="techoutside"data-pltdoc="x"><spanclass="techinside">topics</span></a> are ordinary Racket values which may have embedded
wildcards.</div></p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>procedure</p></div></div><pclass="RForeground"><spanclass="RktPn">(</span><aname="(def._((lib._marketplace/main..rkt)._wild))"></a><spantitle="Provided from: marketplace, marketplace/sugar-untyped, marketplace/sugar-typed"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._wild%29%29"class="RktValDef RktValLink"data-pltdoc="x">wild</a></span></span><spanclass="RktPn"></span><spanclass="RktPn">)</span><spanclass="hspace"> </span>→<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Topic%29%29"class="RktValLink"data-pltdoc="x">Topic</a></span></p></blockquote></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>syntax</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/sugar-untyped..rkt)._~3f))"></a><spantitle="Provided from: marketplace, marketplace/sugar-untyped, marketplace/sugar-typed"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._~3f%29%29"class="RktValDef RktValLink"data-pltdoc="x">?</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Topic%29%29"class="RktValLink"data-pltdoc="x">Topic</a></span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><divclass="SIntrapara">Each time <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._~3f%29%29"class="RktValLink"data-pltdoc="x">?</a></span> (or <spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._wild%29%29"class="RktValLink"data-pltdoc="x">wild</a></span><spanclass="RktPn">)</span>) is used in an expression
destructure <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._role%29%29"class="RktValLink"data-pltdoc="x">role</a></span> instances.</div></p><p>A <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._role%29%29"class="RktValLink"data-pltdoc="x">role</a></span> describes the conversational role of a peer as seen by
notification carrying the role</p><blockquoteclass="SCodeFlow"><p><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._role%29%29"class="RktValLink"data-pltdoc="x">role</a></span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">publisher</span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">foo</span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">participant</span><spanclass="RktPn">)</span></p></blockquote><p>Notice that the orientation of the role is the opposite of the
orientation of the endpoint.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.Orientation))"></a><spantitle="Provided from: marketplace, marketplace/sugar-untyped, marketplace/sugar-typed"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Orientation%29%29"class="RktValDef RktValLink"data-pltdoc="x">Orientation</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.U%29%29"class="RktStxLink"data-pltdoc="x">U</a></span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">publisher</span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">subscriber</span><spanclass="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><divclass="SIntrapara">Describes an endpoint’s orientation: will it be acting as a publisher
<spanclass="RktVal">'</span><spanclass="RktVal">publisher</span>) tend to use <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._send-message%29%29"class="RktValLink"data-pltdoc="x">send-message</a></span> and tend to
(<spanclass="RktVal">'</span><spanclass="RktVal">subscriber</span>) tend to use <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._send-feedback%29%29"class="RktValLink"data-pltdoc="x">send-feedback</a></span> and respond
to messages from publishers.</div></p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.Interest.Type))"></a><spantitle="Provided from: marketplace, marketplace/sugar-untyped, marketplace/sugar-typed"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Interest.Type%29%29"class="RktValDef RktValLink"data-pltdoc="x">InterestType</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.U%29%29"class="RktStxLink"data-pltdoc="x">U</a></span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">participant</span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">observer</span><spanclass="hspace"> </span><spanclass="RktVal">'</span><spanclass="RktVal">everything</span><spanclass="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><divclass="SIntrapara">Using interest-type <spanclass="RktVal">'</span><spanclass="RktVal">participant</span> in an endpoint’s role
indicates that the endpoint is intending to act as a genuine
participant in whatever protocol is associated with the endpoint and
its topic.</div></p><p>Using <spanclass="RktVal">'</span><spanclass="RktVal">observer</span> indicates that the endpoint is intended to
<spanstyle="font-style: italic">monitor</span> other ongoing (participant) conversations instead.
Observer endpoints receive presence and absence notifications about
participant endpoints, but participant endpoints only receive
notifications about other participant endpoints, and not about
observer endpoints.</p><p>The <spanclass="RktVal">'</span><spanclass="RktVal">observer</span> interest-type is intended to make it easier to
monitor resource demand and supply. The monitoring endpoints/processes
can react to changing demand by creating or destroying resources to
match.</p><p>Finally, the <spanclass="RktVal">'</span><spanclass="RktVal">everything</span> interest-type receives notifications
about presence and absence of <spanstyle="font-style: italic">all</span> the types of endpoint,
<spanclass="RktVal">'</span><spanclass="RktVal">participant</span>, <spanclass="RktVal">'</span><spanclass="RktVal">observer</span>, and <spanclass="RktVal">'</span><spanclass="RktVal">everything</span>.
Endpoints with interest-type <spanclass="RktVal">'</span><spanclass="RktVal">everything</span> are rare: they are
relevant for managing demand for <spanstyle="font-style: italic">observers</span>, as well as in some
cases of cross-layer presence/absence propagation. Most programs (and
even most drivers) will not need to use the <spanclass="RktVal">'</span><spanclass="RktVal">everything</span>
message that has been sent on a VM’s IPC facility.</div></p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._presence-event-role))"></a><aname="(def._((lib._marketplace/main..rkt)._presence-event~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3apresence-event))"></a><aname="(def._((lib._marketplace/main..rkt)._presence-event))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._presence-event%29%29"class="RktValDef RktValLink"data-pltdoc="x">presence-event</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">role</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">role</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Role%29%29"class="RktValLink"data-pltdoc="x">Role</a></span></td></tr></table></blockquote></div><divclass="SIntrapara">Indicates the arrival of a new conversational partner: an endpoint
with a topic that intersects our own, with <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Orientation%29%29"class="RktValLink"data-pltdoc="x">Orientation</a></span>
opposite to our own.</div></p><p>The <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._presence-event-role%29%29"class="RktValLink"data-pltdoc="x">presence-event-role</a></span> describes the arriving peer, or more
peer. In particular, the <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._role-orientation%29%29"class="RktValLink"data-pltdoc="x">role-orientation</a></span> of the
<spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._presence-event-role%29%29"class="RktValLink"data-pltdoc="x">presence-event-role</a></span> is the orientation that the <spanstyle="font-style: italic">peer</span>
supplied in its <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._add-endpoint%29%29"class="RktValLink"data-pltdoc="x">add-endpoint</a></span> structure.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._absence-event-reason))"></a><aname="(def._((lib._marketplace/main..rkt)._absence-event-role))"></a><aname="(def._((lib._marketplace/main..rkt)._absence-event~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3aabsence-event))"></a><aname="(def._((lib._marketplace/main..rkt)._absence-event))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._absence-event%29%29"class="RktValDef RktValLink"data-pltdoc="x">absence-event</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">role</span><spanclass="stt"></span><spanclass="RktSym">reason</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">role</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Role%29%29"class="RktValLink"data-pltdoc="x">Role</a></span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">reason</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Any%29%29"class="RktStxLink"data-pltdoc="x">Any</a></span></td></tr></table></blockquote></div><divclass="SIntrapara">Indicates the departure of an existing conversational partner, through
either an explicit <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._delete-endpoint%29%29"class="RktValLink"data-pltdoc="x">delete-endpoint</a></span> action or the implicit
deleting of all of a process’s endpoints when a process exits.</div></p><p>The <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._absence-event-role%29%29"class="RktValLink"data-pltdoc="x">absence-event-role</a></span> describes the departing peer,
analogously to <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._presence-event-role%29%29"class="RktValLink"data-pltdoc="x">presence-event-role</a></span>.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._message-event-message))"></a><aname="(def._((lib._marketplace/main..rkt)._message-event-role))"></a><aname="(def._((lib._marketplace/main..rkt)._message-event~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3amessage-event))"></a><aname="(def._((lib._marketplace/main..rkt)._message-event))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._message-event%29%29"class="RktValDef RktValLink"data-pltdoc="x">message-event</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">role</span><spanclass="stt"></span><spanclass="RktSym">message</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">role</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Role%29%29"class="RktValLink"data-pltdoc="x">Role</a></span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">message</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Message%29%29"class="RktValLink"data-pltdoc="x">Message</a></span></td></tr></table></blockquote></div><divclass="SIntrapara">Indicates the arrival of a message matching the topic pattern in the
in an <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._at-meta-level%29%29"class="RktValLink"data-pltdoc="x">at-meta-level</a></span> structure, the action is to apply to
the process’s containing VM.</div></p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._at-meta-level-preaction))"></a><aname="(def._((lib._marketplace/main..rkt)._at-meta-level~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3aat-meta-level))"></a><aname="(def._((lib._marketplace/main..rkt)._at-meta-level))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._at-meta-level%29%29"class="RktValDef RktValLink"data-pltdoc="x">at-meta-level</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">preaction</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">preaction</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Pre.Action%29%29"class="RktValLink"data-pltdoc="x">PreAction</a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="RktPn">)</span></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.At.Meta.Level))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.At.Meta.Level%29%29"class="RktValDef RktValLink"data-pltdoc="x">AtMetaLevel</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.All%29%29"class="RktStxLink"data-pltdoc="x">All</a></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._at-meta-level%29%29"class="RktValLink"data-pltdoc="x">at-meta-level</a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="RktPn">)</span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><divclass="SIntrapara">An <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._at-meta-level%29%29"class="RktValLink"data-pltdoc="x">at-meta-level</a></span> structure wraps a plain action, and makes it
apply to the outer VM instead of the inner VM (the default).</div></p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._yield-k))"></a><aname="(def._((lib._marketplace/main..rkt)._yield~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3ayield))"></a><aname="(def._((lib._marketplace/main..rkt)._yield))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="high-level-interface.html#%28form._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._yield%29%29"class="RktStxDef RktStxLink"data-pltdoc="x">yield</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">k</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">k</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Interrupt.K%29%29"class="RktValLink"data-pltdoc="x">InterruptK</a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="RktPn">)</span></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.Yield))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Yield%29%29"class="RktValDef RktValLink"data-pltdoc="x">Yield</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.All%29%29"class="RktStxLink"data-pltdoc="x">All</a></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="high-level-interface.html#%28form._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._yield%29%29"class="RktStxLink"data-pltdoc="x">yield</a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="RktPn">)</span><spanclass="RktPn">)</span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><divclass="SIntrapara">Because current VM implementations are cooperatively scheduled, it can
using a <spanclass="RktSym"><ahref="high-level-interface.html#%28form._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._yield%29%29"class="RktStxLink"data-pltdoc="x">yield</a></span> action. When control returns to the yielding
process, the <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._yield-k%29%29"class="RktValLink"data-pltdoc="x">yield-k</a></span> is invoked.</div></p><h5>3.4.1<tt> </tt><aname="(part._endpoints-and-messages)"></a>Endpoints and Messages</h5><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._add-endpoint-handler))"></a><aname="(def._((lib._marketplace/main..rkt)._add-endpoint-role))"></a><aname="(def._((lib._marketplace/main..rkt)._add-endpoint-pre-eid))"></a><aname="(def._((lib._marketplace/main..rkt)._add-endpoint~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3aadd-endpoint))"></a><aname="(def._((lib._marketplace/main..rkt)._add-endpoint))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._add-endpoint%29%29"class="RktValDef RktValLink"data-pltdoc="x">add-endpoint</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">pre-eid</span><spanclass="stt"></span><spanclass="RktSym">role</span><spanclass="stt"></span><spanclass="RktSym">handler</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">pre-eid</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Any%29%29"class="RktStxLink"data-pltdoc="x">Any</a></span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">role</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Role%29%29"class="RktValLink"data-pltdoc="x">Role</a></span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">handler</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Handler%29%29"class="RktValLink"data-pltdoc="x">Handler</a></span><spanclass="hspace"> </span><spanclass="RktSym">State</span><spanclass="RktPn">)</span></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.Add.Endpoint))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Add.Endpoint%29%29"class="RktValDef RktValLink"data-pltdoc="x">AddEndpoint</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.All%29%29"class="RktStxLink"data-pltdoc="x">All</a></span><spanclass="hspace"> </span><spanclass="RktPn">
events pertaining to the given role occur, the <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Handler%29%29"class="RktValLink"data-pltdoc="x">Handler</a></span> is
in the containing VM’s container.</span></span></div></p><p>The name of the new endpoint will be the <spanclass="RktSym">pre-eid</span>; it must be
unique within the current process, but otherwise can be any value at
all. If the endpoint’s name matches an existing endpoint, and the new
role is the same as the existing endpoint’s role, the handler function
is <spanstyle="font-style: italic">replaced</span> in the existing endpoint.</p><p>To delete an endpoint, perform a <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._delete-endpoint%29%29"class="RktValLink"data-pltdoc="x">delete-endpoint</a></span> action built
with the name of the endpoint to delete.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._delete-endpoint-reason))"></a><aname="(def._((lib._marketplace/main..rkt)._delete-endpoint-pre-eid))"></a><aname="(def._((lib._marketplace/main..rkt)._delete-endpoint~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3adelete-endpoint))"></a><aname="(def._((lib._marketplace/main..rkt)._delete-endpoint))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._delete-endpoint%29%29"class="RktValDef RktValLink"data-pltdoc="x">delete-endpoint</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">pre-eid</span><spanclass="stt"></span><spanclass="RktSym">reason</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">pre-eid</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Any%29%29"class="RktStxLink"data-pltdoc="x">Any</a></span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">reason</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Any%29%29"class="RktStxLink"data-pltdoc="x">Any</a></span></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.Delete.Endpoint))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Delete.Endpoint%29%29"class="RktValDef RktValLink"data-pltdoc="x">DeleteEndpoint</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._delete-endpoint%29%29"class="RktValLink"data-pltdoc="x">delete-endpoint</a></span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><divclass="SIntrapara">Deletes an existing endpoint named <spanclass="RktSym">pre-eid</span>. The given
<spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._absence-event%29%29"class="RktValLink"data-pltdoc="x">absence-event</a></span>.</div></p><p>If no specific reason is needed, it is conventional to supply
<spanclass="RktVal">#f</span> as the <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._delete-endpoint-reason%29%29"class="RktValLink"data-pltdoc="x">delete-endpoint-reason</a></span>. See also the
function from <spanclass="RktSym">marketplace/sugar-values</span>.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._send-message-orientation))"></a><aname="(def._((lib._marketplace/main..rkt)._send-message-body))"></a><aname="(def._((lib._marketplace/main..rkt)._send-message~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3asend-message))"></a><aname="(def._((lib._marketplace/main..rkt)._send-message))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._send-message%29%29"class="RktValDef RktValLink"data-pltdoc="x">send-message</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">body</span><spanclass="stt"></span><spanclass="RktSym">orientation</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">body</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Message%29%29"class="RktValLink"data-pltdoc="x">Message</a></span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">orientation</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Orientation%29%29"class="RktValLink"data-pltdoc="x">Orientation</a></span></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.Send.Message))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Send.Message%29%29"class="RktValDef RktValLink"data-pltdoc="x">SendMessage</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._send-message%29%29"class="RktValLink"data-pltdoc="x">send-message</a></span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><divclass="SIntrapara">Sends a message to peers.<spanclass="NoteBox"><spanclass="NoteContent">Or, if <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._at-meta-level%29%29"class="RktValLink"data-pltdoc="x">at-meta-level</a></span>, peers of
the containing VM.</span></span> The given <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Orientation%29%29"class="RktValLink"data-pltdoc="x">Orientation</a></span> should describe the
some publisher, it will be <spanclass="RktVal">'</span><spanclass="RktVal">subscriber</span>.
See also the <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._send-message%29%29"class="RktValLink"data-pltdoc="x">send-message</a></span> and
<spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._send-feedback%29%29"class="RktValLink"data-pltdoc="x">send-feedback</a></span> convenience functions from
wrapped in an <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._at-meta-level%29%29"class="RktValLink"data-pltdoc="x">at-meta-level</a></span>, the new process will instead be
a sibling of the creating process’s VM.</span></span>. The <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._spawn-k%29%29"class="RktValLink"data-pltdoc="x">spawn-k</a></span> runs in
PID of the new process.</div></p><p>The <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._spawn-spec%29%29"class="RktValLink"data-pltdoc="x">spawn-spec</a></span> describes the new process to be created. Its
<spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._process-spec-boot%29%29"class="RktValLink"data-pltdoc="x">process-spec-boot</a></span> field is a function taking the PID of the
complexity: see <spanclass="RktSym"><ahref="high-level-interface.html#%28form._%28%28lib._marketplace%2Fsugar-typed..rkt%29._spawn~3a%29%29"class="RktStxLink"data-pltdoc="x">spawn:</a></span> for an easier-to-use, higher-level
approach.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>struct</p></div></div><tablecellspacing="0"class="RForeground"><tr><td><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/reference/define-struct.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29"class="RktStxLink"data-pltdoc="x">struct</a></span></td><td><spanclass="hspace"> </span></td><td><aname="(def._((lib._marketplace/main..rkt)._quit-reason))"></a><aname="(def._((lib._marketplace/main..rkt)._quit-pid))"></a><aname="(def._((lib._marketplace/main..rkt)._quit~3f))"></a><aname="(def._((lib._marketplace/main..rkt)._struct~3aquit))"></a><aname="(def._((lib._marketplace/main..rkt)._quit))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._quit%29%29"class="RktValDef RktValLink"data-pltdoc="x">quit</a></span></span><spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym">pid</span><spanclass="stt"></span><spanclass="RktSym">reason</span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span></td><td><spanclass="hspace"> </span></td><td><spanclass="RktPn">#:prefab</span><spanclass="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">pid</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktPn">(</span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Option%29%29"class="RktStxLink"data-pltdoc="x">Option</a></span><spanclass="hspace"> </span><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.P.I.D%29%29"class="RktValLink"data-pltdoc="x">PID</a></span><spanclass="RktPn">)</span></td></tr><tr><td><spanclass="hspace"> </span><spanclass="RktSym">reason</span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Any%29%29"class="RktStxLink"data-pltdoc="x">Any</a></span></td></tr></table></td></tr><tr><td><tablecellspacing="0"class="together"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.Quit))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.Quit%29%29"class="RktValDef RktValLink"data-pltdoc="x">Quit</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-values..rkt%29._quit%29%29"class="RktValLink"data-pltdoc="x">quit</a></span></p></blockquote></td></tr></table></td></tr></table></blockquote></div><divclass="SIntrapara">Kills a sibling process.<spanclass="NoteBox"><spanclass="NoteContent">Or, if <spanclass="RktSym"><ahref="high-level-interface.html#%28def._%28%28lib._marketplace%2Fsugar-untyped..rkt%29._at-meta-level%29%29"class="RktValLink"data-pltdoc="x">at-meta-level</a></span>, a sibling
process of the containing VM.</span></span> If <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._quit-pid%29%29"class="RktValLink"data-pltdoc="x">quit-pid</a></span> is <spanclass="RktVal">#f</span>,
PID. The <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._quit-reason%29%29"class="RktValLink"data-pltdoc="x">quit-reason</a></span> is passed on to peers of
<spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._absence-event%29%29"class="RktValLink"data-pltdoc="x">absence-event</a></span>, just as if each active endpoint were deleted
<spanclass="RktVal">#f</span> as the <spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._quit-reason%29%29"class="RktValLink"data-pltdoc="x">quit-reason</a></span>.</p><p><divclass="SIntrapara"><blockquoteclass="SVInsetFlow"><tablecellspacing="0"class="boxed RBoxed"><tr><td><blockquoteclass="SubFlow"><divclass="RBackgroundLabel SIEHidden"><divclass="RBackgroundLabelInner"><p>type</p></div></div><pclass="RForeground"><aname="(def._((lib._marketplace/main..rkt)._.P.I.D))"></a><spantitle="Provided from: marketplace"><spanclass="RktSym"><ahref="low-level-interface.html#%28def._%28%28lib._marketplace%2Fmain..rkt%29._.P.I.D%29%29"class="RktValDef RktValLink"data-pltdoc="x">PID</a></span></span><spanclass="hspace"> </span>:<spanclass="hspace"> </span><spanclass="RktSym"><ahref="http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Number%29%29"class="RktStxLink"data-pltdoc="x">Number</a></span></p></blockquote></td></tr></table></blockquote></div><divclass="SIntrapara">In the current VM implementations, process IDs are simply numbers.
PIDs are scoped to and allocated by each individual VM instance.</div></p><divclass="navsetbottom"><spanclass="navleft"> </span><spanclass="navright"> <ahref="high-level-interface.html"title="backward to "2 High-level interface""data-pltdoc="x">← prev</a> <ahref="index.html"title="up to "Marketplace: Network-Aware Programming""data-pltdoc="x">up</a> <ahref="Drivers.html"title="forward to "4 Drivers""data-pltdoc="x">next →</a></span> </div></div></div><divid="contextindicator"> </div></body></html>