def pack_queue_purge_parameters(queue_name: QueueName, no_wait: bool, encoding: str) -> bytes: bio = BytesIO() bio.write(RESERVED_SHORT_UINT_DATA) build_shortstr(bio, queue_name, encoding) bio.write(pack_boolean(no_wait)) return bio.getvalue()
def pack_connection_open_parameters(virtualhost: VirtualHost, capabilities: List[str], insist: bool, encoding: str) -> bytes: bio = BytesIO() build_shortstr(bio, virtualhost, encoding) build_split_shortstr(bio, capabilities, encoding), bio.write(pack_boolean(insist)) return bio.getvalue()
def pack_queue_bind_parameters(queue_name: QueueName, exchange_name: ExchangeName, routing_key: RoutingKey, no_wait: bool, arguments: FieldTable, encoding: str, rabbitmq: bool) -> bytes: bio = BytesIO() bio.write(RESERVED_SHORT_UINT_DATA) build_shortstr(bio, queue_name, encoding) build_shortstr(bio, exchange_name, encoding) build_shortstr(bio, routing_key, encoding) bio.write(pack_boolean(no_wait)) build_field_table(bio, arguments, encoding, rabbitmq) return bio.getvalue()
def pack_basic_qos_parameters(prefetch_size: int, prefetch_count: int, global_: bool) -> bytes: return pack_long_uint(prefetch_size) + pack_short_uint(prefetch_count) + pack_boolean(global_)
def pack_basic_reject_parameters(delivery_tag: DeliveryTag, requeue: bool) -> bytes: return pack_long_long_uint(delivery_tag) + pack_boolean(requeue)
def pack_basic_ack_parameters(delivery_tag: DeliveryTag, multiple: bool) -> bytes: return pack_long_long_uint(delivery_tag) + pack_boolean(multiple)
def pack_basic_cancel_parameters(consumer_tag: ConsumerTag, no_wait: bool, encoding: str) -> bytes: bio = BytesIO() build_shortstr(bio, consumer_tag, encoding) bio.write(pack_boolean(no_wait)) return bio.getvalue()