Buy是RabbitMQ的客户端开发包,专注于易用性。它功能齐全,支持所有最近的RabbitMQ功能,并且没有任何重量级的依赖关系。
示例代码:
require"buy"#StartacommuicatiosessiowithRabbitMQco=Buy.ewco.start#opeachaelch=co.create_chael#declareaqueueq=ch.queue("test1")#publishamessagetothedefaultexchagewhichthegetsroutedtothisqueueq.publish("Hello,everybody!")#fetchamessagefromthequeuedelivery_ifo,metadata,payload=q.popputs"Thisisthemessage:#{payload}"#closethecoectioco.stop
评论