0.3.1 • Published 9 years ago

promise.io v0.3.1

Weekly downloads
1
License
-
Repository
github
Last release
9 years ago

Fancy RPC library using socket.io and promises!

Circle CI

Design Decisions

CoffeeScript

Promise.IO is written in CoffeeScript, and as such its API is geared towards usage in CoffeeScript. Where possible, helper utilities are provided to make it easier for pure JavaScript usage -- but keep in mind that pure JavaScript is treated as a second-class citizen in Promise.IO.

Promises

Promise.IO makes gratuitous use of Promises, because let's face it -- callbacks suck. In particular, the lightweight and efficient Q library is used. Promises let you do really cool things, like not have to live in callback hell all your life. You can also set timeouts on your RPC calls! Your calls can even use .notify() promise functions to get progress notifications from the remote, in the same way you would with local promises.

CoffeeScript Server Example

server = new PromiseIO {
  someFunc: (input) ->
    return 'I got: ' + input
}

server.listen 3000

CoffeeScript Client Example

client = new PromiseIO

client.connect 'http://localhost:3000'
  .then (remote) ->    remote.someFunc 'my variable!'
      .then (returnVal) -> console.log returnVal
      .catch (err) -> console.log err
0.3.1

9 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago