UWNetworksLab / freedom

Embracing a distributed web
13 stars 5 forks source link

Hub refactor #11

Closed willscott closed 11 years ago

willscott commented 11 years ago

This set of changes rewrites the hub of freedom in a way that doesn't identify application only by their manifest, but rather allows for more expressive control of the routing tree.

Most freedom modules should be compatible without code changes. The only API which changes is core.CreateChannel. This API changes from returning a message object directly to returning {proxy: deferred, identifier: string}.

The identifier is then passed to the destination core.BindChannel() location, at which point the deferred object will resolve with the now available message passing object.

This change was made because (a) the conversion between a proxy object and its identifier had been a big hack. and (b) because currently the message objects can only be created by bound proxies.

willscott commented 11 years ago

I checked with Paul that the socket behavior I was seeing in uproxy was identical before and after this refactor. The client and server.js modules will need to change to handle the new interface for custom channels.