2.2.13 • Published 5 years ago

melf v2.2.13

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Melf

npm module to perform (a)synchronous remote procedure calls for JavaScript processes. Synchronous remote procedure calls can be interleaved (only) by locally declared remote procedures without deadlocks.

Client API

require("melf")(address, alias, callback)

  • address :: string | object | melf.Receptor
  • alias :: string
  • callback(error, melf)
    • error :: Error | null
    • melf :: melf.Melf

output = melf.rpcall(recipient, rpname, input)

  • recipient :: string
  • rpname :: string
  • input :: JSON
  • output :: JSON

melf.rpcall(recipient, rpname, input, (error, output) => {...})

  • recipient :: string
  • rpname :: string
  • input :: JSON
  • error :: Error | null
  • output :: JSON

melf.rprocedures[rpname] = (origin, input, callback) => {...}

  • rpname :: string
  • origin :: string
  • input :: JSON
  • callback(error, output)
    • error :: Error | null
    • output :: JSON

melf.destroy()

melf.terminate()

melf.onterminate = () => { ... }

Server API

distributor = require("melf/distributor")(logger)

  • logger(origin, recipient, meteor) | undefined | boolean
    • origin :: string
    • recipient :: string
    • meteor :: string
  • distributor :: melf.Distributor

listener = orchestrator.ConnectionListener()

  • listener(net.Socket)

middleware = distributor.RequestMiddleware(splitter)

  • splitter :: string | undefined
  • handled = middleware(request, response, next)
    • request :: http.Request
    • response :: http.Response
    • next()
    • handled :: boolean

middleware = distributor.UpgradeMiddleware(splitter)

  • splitter :: string | undefined
  • handled = middleware(request, socket, head, next)
    • request :: http.Request
    • socket :: net.Socket
    • head :: Buffer
    • next()
    • handled :: boolean
2.2.13

5 years ago

2.2.12

5 years ago

2.2.11

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.8

5 years ago

2.2.7

5 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.15

5 years ago

2.0.14

5 years ago

2.0.13

5 years ago

2.0.12

5 years ago

2.0.11

5 years ago

2.0.10

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.7

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.5

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago