Giter Club home page Giter Club logo

Comments (3)

fafhrd91 avatar fafhrd91 commented on May 24, 2024
  1. you just call topic_filter multiple time, sink.subscribe().topic_filter(“topic1”).topic_filter(“topic2”) etc
  2. post compilation error, you may need to do something like fn_service(move |…

btw this is for discussions rather than issues

from ntex-mqtt.

xudesheng avatar xudesheng commented on May 24, 2024
  1. you just call topic_filter multiple time, sink.subscribe().topic_filter(“topic1”).topic_filter(“topic2”) etc
  2. post compilation error, you may need to do something like fn_service(move |…

btw this is for discussions rather than issues

Thank you!!! yes, the fn_service(move | works. One more question:

The publish.ack(Success) consumes the entire publish but indeed it only needs the packet_id. I have to copy topic and payload when I want to send the content out.

Is there an API like: pub fn ack(&self, reason_code: codec::PublishAckReason) -> ControlResult which doesn't need the entire publish to create a control message? The current API is: pub fn ack(self, reason_code: codec::PublishAckReason) -> ControlResult.

v5::client::ControlMessage::Publish(publish) => {
                log::info!(
                    "incoming publish: {:?} -> {:?} payload {:?}",
                    publish.packet().packet_id,
                    publish.packet().topic,
                    publish.packet().payload
                );
                let res = publish.ack(v5::codec::PublishAckReason::Success); // the publish is consumed here.
                if let Err(e) = tx.send(publish) { //can't send it anymore.
                    log::error!("Error sending publish: {:?}", e);
                }

                Ready::Ok(res)
            }

from ntex-mqtt.

xudesheng avatar xudesheng commented on May 24, 2024

close and move to discussion.

from ntex-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.