用于 rabbitmq-c 的 Objective-C 封装。
platform :ios, '7.0'
pod "OLRabbitMQ", "~> 0.0.2"
OLRabbitMQSocket _socketAMQP = [[OLRabbitMQSocket alloc] initWithIp:<address ip> port:<port>];
[_socketAMQP createSocketWithVhost:<vhost> login:<login> password:<password> callback:^(BOOL ready, NSError *error) {
// your implementation...
}];
OLRabbitMQExchange *exchange = [[OLRabbitMQExchange alloc] initWithSocket:<OLRabbitMQSocket instance>];
[exchange bindExchange:<exchange string name> routingKey:<exchange routing key string>];
OLRabbitMQExchange *exchange = [[OLRabbitMQExchange alloc] initWithSocket:<OLRabbitMQSocket instance>];
[exchange unbindExchange:<exchange string name> routingKey:<exchange routing key string>];
[exchange basicConsume];
OLRabbitMQOperation *operation = [[OLRabbitMQOperation alloc] initWithSocket:<OLRabbitMQSocket instance>];
operation.delegate = self;
[[NSOperationQueue new] addOperation:operation];
- (void)amqpResponse:(NSData *)data routingKey:(NSString *)routingKey;
请注意,您不能共享套接字 'OLRabbitMQSocket'。OLRabbitMQ 使用 librabbitmq-c。librabbitmq 库是用事件驱动、单线程应用程序构建的。
2015 (C) 版权所有 Open-RnD Sp. z o.o.
在 Apache License,版本 2.0(“许可证”)下授权;
除非符合许可证的约定或书面,否则不得使用此文件。
您可以在此获得许可证副本:
https://apache.ac.cn/licenses/LICENSE-2.0
除非适用的法律要求或书面同意,否则在许可证下分发的软件
以“原样”为基础分发,不提供任何明示或暗示的保证。
有关许可证下权限和限制的具体语言,请参阅许可证。
除非适用法律或书面同意,软件分销商不得因故将软件分发。
许可证。