racket-bertrpc /

Filename Size Date modified Message
42 B
1.3 KB
1.5 KB
1.2 KB
2.4 KB
371 B
92 B
674 B
3.1 KB

racket-bertrpc

A BERT-RPC client library for Racket language.

See the full BERT specification at bert-rpc.org.

This library currentli only supports the following BERT-RPC features:

  • call request
  • cast request

Since this library version depends on BERT serialization library, implemented in R^6RS, you've got to require mutable pairs. See examples section below.

Installation

Require this library in your project:

(require (planet yasir/racket-bertrpc:1))

Examples

Import the library and create an RPC transport:

#lang racket
(require racket/mpair)
(require (prefix-in bertrpc: (planet yasir/racket-bertrpc:1)))

(define transport (bertrpc:from-uri "bert://192.168.32.40:9999"))

Make a call:

(bertrpc:call transport 'calc 'add (mlist 40 2))

Note that the underlying BERT-RPC transaction of the above call is:

-> {call, calc, add, [40, 2]}
<- {reply, 42}

In this example, the return value of the call is 42.


Make a cast:

(bertrpc:cast transport 'stats 'incr (mlist))

Note that the underlying BERT-RPC transaction of the above cast is:

-> {cast, stats, incr, []}
<- {noreply}

The return value of the above cast is 'nil for all successful cast calls.

TODO

  • Implement timeouts (probably using vyzo/socket PLaneT library).
  • Implement BERT serialization library in Racket and use it instead of the current, which is R^6RS.

Copyright (c) 2011 Yasir M. Arsanukaev. See LICENSE for details.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.