Antti / rust-amqp

AMQP client in pure rust. Corresponds to rabbitmq spec.
MIT License
247 stars 45 forks source link

Execution hangs when nowait is set to true #35

Open kopiczko opened 8 years ago

kopiczko commented 8 years ago

Execution of the code below hangs. When nowait parameter is set to false it returns immediately. I believe it also affects all API's with nowait parameter.

    let mut ses = Session::open_url(url).unwrap();
    let mut ch = ses.open_channel(1).unwrap();
    println!("declaring exchange");
    ch.exchange_declare("test-exchange",
                          "fanout",
                          false, // pssive
                          false, // durable
                          true, // auto_delete
                          false, // internal
                          true, // nowait - hangs when set to true
                          Table::new())
        .unwrap();
Antti commented 8 years ago

Oh. Good catch. For now the client just ignores this parameter, and still waits for the reply from the server. Instead, it should not wait for the reply and continue. I guess it should be easy to fix, although the signature of the method would change (since it can not return response from the server).

kopiczko commented 8 years ago

Java libraries expose additional echangeDeclareNowait method for the same reason I suppose.