예제 #1
0
def parse_basic_publish_parameters(bio: BytesIO, encoding: str, rabbitmq: bool) -> BasicPublishParameters:
    parse_binary_shortstr(bio)
    return BasicPublishParameters(
        parse_shortstr(bio, encoding),
        parse_shortstr(bio, encoding),
        *parse_booleans(bio, 2)
    )
예제 #2
0
def parse_exchange_declare_parameters(
        bio: BytesIO, encoding: str,
        rabbitmq: bool) -> ExchangeDeclareParameters:
    parse_binary_shortstr(bio)  # reserved
    return ExchangeDeclareParameters(
        parse_shortstr(bio, encoding), parse_shortstr(bio, encoding),
        *parse_booleans(bio, 5), parse_field_table(bio, encoding, rabbitmq))
예제 #3
0
def parse_basic_consume_parameters(bio: BytesIO, encoding: str, rabbitmq: bool) -> BasicConsumeParameters:
    parse_binary_shortstr(bio)
    return BasicConsumeParameters(
        parse_shortstr(bio, encoding),
        parse_shortstr(bio, encoding),
        *parse_booleans(bio, 4),
        parse_field_table(bio, encoding, rabbitmq)
    )
예제 #4
0
def parse_basic_nack_parameters(bio: BytesIO, encoding: str, rabbitmq: bool) -> BasicNackParameters:
    return BasicNackParameters(
        parse_long_long_uint(bio),
        *parse_booleans(bio, 2)
    )
예제 #5
0
파일: queue.py 프로젝트: arthurdarcet/ammoo
def parse_queue_declare_parameters(bio: BytesIO, encoding: str,
                                   rabbitmq: bool) -> QueueDeclareParameters:
    parse_binary_shortstr(bio)
    return QueueDeclareParameters(parse_shortstr(bio, encoding),
                                  parse_booleans(bio, 5),
                                  parse_field_table(bio, encoding, rabbitmq))
예제 #6
0
def parse_exchange_delete_parameters(
        bio: BytesIO, encoding: str,
        rabbitmq: bool) -> ExchangeDeleteParameters:
    parse_binary_shortstr(bio)  # reserved
    return ExchangeDeleteParameters(parse_shortstr(bio, encoding),
                                    *parse_booleans(bio, 2))