The Links standard library implements four functions for creating access points: new, newServerAP, newClientAP, and newAP. Of these, only new is implemented on the client.
This simple patch implements (at least stubs for) the other three. We use the same assumptions as spawn, and only support creating APs on the local client rather than the server or another client. newClientAP is simply wired to new.
This allows us to run, e.g.,
fun main() {
var _ = spawnClient {
var ap = newClientAP();
var _ = spawn { var s = accept(ap); close(send((), s)) };
var t = request(ap);
var ((), t) = receive(t);
close(t);
print("done")
};
page <html></html>
}
serveThis(main)
The Links standard library implements four functions for creating access points:
new
,newServerAP
,newClientAP
, andnewAP
. Of these, onlynew
is implemented on the client.This simple patch implements (at least stubs for) the other three. We use the same assumptions as
spawn
, and only support creating APs on the local client rather than the server or another client.newClientAP
is simply wired tonew
.This allows us to run, e.g.,