Proxy

From Erights

(Difference between revisions)
Jump to: navigation, search
(new page: add description of proxies, and makeProxy protocol)
(categories)
Line 40: Line 40:
XXX document these
XXX document these
 +
 +
[[Category:ELib specification]]
 +
[[Category:Protocols]]

Revision as of 02:37, 2 July 2008

A proxy is an eventual reference whose behavior is specified by other references.

In current implementations, all eventual references are either primitive promises or proxies, and proxies are the only way to create far references and pipelining remote promises.

makeEProxyResolver

See [1] for documentation. This protocol is deprecated because clients of it may break sameness by creating proxies with the same identity but different behavior.

makeProxy

The new proxy maker protocol, which is robust and available as a safe import. See [2] and the nearby thread for the discussion of its creation.

FQN (importable): org.erights.e.ref.makeProxy

Methods:

Creates a new proxy. handler is the handler for messages sent to the proxy; resolutionSlot specifies the resolution (see below); far is true if the proxy is to be a Far ref and false for a remote promise.

For a given handler and resolutionSlot,

  • all results of makeProxy.run(handler, resolutionSlot, false) are the same.
  • all results of makeProxy.run(handler, resolutionSlot, true) between which resolutionSlot has not further resolved (as in TraversalKey) are the same.

The resolutionSlot should be a vow for a FinalSlot whose value is the reference to which this proxy resolves. As soon as resolutionSlot is itself resolved, the proxy will turn into its resolution; handler will never again be invoked.

Far proxies may only be resolved to broken references; if the resolution is something else, or if resolutionSlot resolves to something not a FinalSlot, then the proxy will resolve to a broken reference whose (sealed, if applicable) problem indicates that error.

Send and sendOnly on a proxy send the corresponding handle* messages to handler. Ref.optSealedDispatch on a proxy calls handler.handleOptSealedDispatch immediately.

ProxyHandler

Protocol for the handler supplied by the client of makeProxy.

Methods:

XXX document these

Personal tools
more tools