Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DRb vs RabbitMQ Showdown

DRb vs RabbitMQ Showdown

RubyConf 2012 Talk

Davy Stevenson

November 02, 2012
Tweet

More Decks by Davy Stevenson

Other Decks in Programming

Transcript

  1. r e q u i r e ' d r

    b / d r b ' c l a s s S e r v e r d e f g e t _ d a t a [ 1 , 2 , 3 ] e n d d e f s e n d _ d a t a ( d a t a ) p u t s d a t a e n d e n d D R b . s t a r t _ s e r v i c e ( ' d r u b y : / / l o c a l h o s t : 1 2 3 4 5 ' , S e r v e r . n e w ) D R b . t h r e a d . j o i n % i r b r e q u i r e ' d r b / d r b ' s e r v e r = D R b O b j e c t . n e w _ w i t h _ u r i ( ' d r u b y : / / l o c a l h o s t : 1 2 3 4 5 ' ) s e r v e r . g e t _ d a t a # = > [ 1 , 2 , 3 ] s e r v e r . s e n d _ d a t a ( " H e l l o " ) # = > n i l
  2. r e q u i r e ' a m

    q p ' E M . r u n d o c o n n e c t i o n = A M Q P . c o n n e c t ( : h o s t = > ' l o c a l h o s t ' ) c h a n n e l = A M Q P : : C h a n n e l . n e w ( c o n n e c t i o n ) q u e u e = c h a n n e l . q u e u e ( " e x a m p l e " , : a u t o _ d e l e t e = > t r u e ) e x c h a n g e = c h a n n e l . d i r e c t ( " " ) E M . a d d _ p e r i o d i c _ t i m e r ( 5 . 0 ) d o e x c h a n g e . p u b l i s h " # { T i m e . n o w } " , : r o u t i n g _ k e y = > q u e u e . n a m e e n d q u e u e . s u b s c r i b e d o | p a y l o a d | p u t s " R e c e i v e d t h e t i m e : # { p a y l o a d } " e n d e n d
  3. Q&A