Sha256: 01fbe22aa8a44b83d8d08edd89220ee6c6bb360c2f0bd7a0d42798df91687bf6

Contents?: true

Size: 563 Bytes

Versions: 14

Compression:

Stored size: 563 Bytes

Contents

var io = new RocketIO().connect();
var linda = new Linda(io);
var ts = new linda.TupleSpace("calc");

$(function(){
  $("#btn_request").click(function(){
    var query = $("#txt_request").val();
    ts.write(["calc_request", query]);
  });
});

var take_result = function(){
  ts.take(["calc_result"], function(tuple){
    var result = tuple[1];
    $("#log").prepend( $("<p>").text(result) );
    take_result();
  });
};

io.on("connect", take_result);
io.on("connect", function(){
  ts.watch(["calc_request"], function(tuple){
    console.log(tuple);
  });
});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sinatra-rocketio-linda-0.2.0 sample/public/client.js
sinatra-rocketio-linda-0.1.4 sample/public/client.js
sinatra-rocketio-linda-0.1.3 sample/public/client.js
sinatra-rocketio-linda-0.1.2 sample/public/client.js
sinatra-rocketio-linda-0.1.1 sample/public/client.js
sinatra-rocketio-linda-0.1.0 sample/public/client.js
sinatra-rocketio-linda-0.0.9 sample/public/client.js
sinatra-rocketio-linda-0.0.8 sample/public/client.js
sinatra-rocketio-linda-0.0.7 sample/public/client.js
sinatra-rocketio-linda-0.0.6 sample/public/client.js
sinatra-rocketio-linda-0.0.5 sample/public/client.js
sinatra-rocketio-linda-0.0.4 sample/public/client.js
sinatra-rocketio-linda-0.0.3 sample/public/client.js
sinatra-rocketio-linda-0.0.2 sample/public/client.js