Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 #14

Open
1 of 3 tasks
ahdinosaur opened this issue Aug 7, 2016 · 7 comments
Open
1 of 3 tasks

v3 #14

ahdinosaur opened this issue Aug 7, 2016 · 7 comments

Comments

@ahdinosaur
Copy link
Owner

ahdinosaur commented Aug 7, 2016

  • replace sync permissions with async before, after, around hooks
  • rename service and services to api
  • change handlers to handler (rather than a list, return a single (req, res, next) => { next() } function). or support both.
@ahdinosaur
Copy link
Owner Author

ahdinosaur commented Aug 7, 2016

one open question is whether it's okay if everything is based on separate (server, config) => {} closures. as in, what if your before hooks need to access the same internal variables as your methods? currently you'd attach this to the server or config object, or rely on the fact that methods are attached before permissions, but is this okay? is there a better way?

@ahdinosaur
Copy link
Owner Author

so... i re-wrote vas to only use basic http instead of WebSockets, because of requirements in a client project: http. i need to think about this more, might lead to a more pluggable vas, but not sure quite how yet.

@ahdinosaur
Copy link
Owner Author

ahdinosaur commented Sep 14, 2016

the key to a pluggable vas:

represent multiplexed RPC as a duplex pull stream, where HTTP and WebSocket connections are duplex streams that wrap the generic ones.

in the simplest case, vas is a duplex stream that receives objects that describe method calls and sends objects that describe method call results.

things.get(123) // where things.get is an async method

translates to description:

{
  path: ['things', 'get'],
  args: [123]
}

and value:

{
  value: {
    id: 123,
    name: 'computer'
  }
}

or error:

{
  error: new Error('thing not found.')
}

in this simple case, when a method is a stream (source, sink, or duplex), the result will be that stream. this means it's not serializable, but i'm not sure the muxrpc way of representing method calls as packets over a multiplexed interface makes sense for both HTTP and WebSocket, when i think finding the common ground is key here.

@ahdinosaur
Copy link
Owner Author

let's be honest, in the end i want to re-write muxrpc. although in the near-term i might release a transition major version that uses only HTTP and also implements the original goals up at the top of the thread, because i'm mostly too busy with this current project that is using vas.

probably would help to really learn how muxrpc works:

TODO more notes

@ahdinosaur
Copy link
Owner Author

@pietgeursen began the re-write for version 3: https://github.com/ahdinosaur/vas/tree/v3. my plan is to go slow, aiming for a small and stable interface composed of many small modules, so if you feel any desire to test things as i go i'd really appreciate that. 😄

@pietgeursen
Copy link
Contributor

Yeah, that sounds fun. :)

On Thu, 22 Sep 2016, 10:56 PM Mikey [email protected] wrote:

@pietgeursen https://github.com/pietgeursen began the re-write for
version 3: https://github.com/ahdinosaur/vas/tree/v3. my plan is to go
slow, aiming for a small and stable interface composed of many small
modules, so if you feel any desire to test things as i go i'd really
appreciate that. 😄


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#14 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AKEUel-d9JB6MQc3DMKM4DgxIHjDfJvAks5qsl7tgaJpZM4JedbX
.

@ahdinosaur
Copy link
Owner Author

design now based on #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants