The Ashes

Technology, Science and other news
September 8, 2009

Kamaloka: AMQP implementation in JS

Posted by : admin
Filed under : General

Would you like to talk messaging directly from the browser? Kamaloka is a new library that speaks AMQP. You can easily tie to Orbited but also, in theory, any other library that speaks TCPSockets.

PLAIN TEXT
JAVASCRIPT:

  1.  
  2.    Orbited.settings.port = 9000;
  3.    amqp_broker_port = 7000;
  4.  
  5.    amqp_conn = amqp.Connection({host: ‘localhost’,
  6.                                 port: amqp_broker_port,
  7.                                 send_hook: function(msg) { // for debugging
  8.                                                        append_msg(‘SENT’, msg);
  9.                                                   },
  10.                                 recive_hook: function(data) { // for debugging
  11.                                                         append_msg(‘RECV’, data);
  12.                                                     }
  13.                              });
  14.     amqp_conn.start();
  15.  
  16.     // You should have your server generate a UUID since browser methods
  17.     // are unreliable at best
  18.     session = amqp_conn.create_session(‘not_a_great_id’ + (new Date().getTime() + Math.random()));
  19.  
  20.     var fedoraproject = “org.fedoraproject-“ + session.name;
  21.     session.Queue(‘declare’, {queue:fedoraproject, exclusive:true});
  22.     session.Exchange(‘bind’, {exchange: “amq.topic”,
  23.                               queue: fedoraproject,
  24.                               binding_key: “org.fedoraproject.#”});
  25.  
  26.     // Bind each queue to the control queue so we know when to stop
  27.     session.Exchange(‘bind’, {exchange:“amq.topic”,
  28.                               queue: fedoraproject,
  29.                               binding_key:“control”});
  30.  
Tags :

No Comments

(required)
(will not be published) (required)
(opitional)

cciash.com EN ES IT DE PT CZ FR RU
May 2017
M T W T F S S
« Sep    
1234567
891011121314
15161718192021
22232425262728
293031  

Pages

Categories

Resources

There are many online poker site where you can play but at poker.hk you can play the poker games with all the knowledge you need related to the game with the poker school available in both the English and Chinese language.

Super Casino

Now you can bet on any sports and any sporting events from all the comfort from your home. Bet770 allows you to bet on any events and match with in just 3 clicks. They also offers great odds on football betting for every premier and champions league match. Get £50 free in bets when you register.

Bingo770, offering best online bingo games with £7.70 free no deposit Bonus!