Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Particle.publish() and Particle.subscribe() invoked with default event scope #1365

Merged
merged 1 commit into from Aug 10, 2017

Conversation

@sergeuz
Copy link
Member

commented Aug 8, 2017

Problem

Beginning with 0.8.0 release, Particle.publish() and Particle.subscribe() methods will require event scope to be specified explicitly. This change will potentially break a lot of existing applications.

Solution

Generate deprecation warning when Particle.publish() and Particle.subscribe() are used with a default event scope.

Steps to Test

Compile and run wiring/api test.

Example App

void setup() {
    // Particle.publish()

    Particle.publish("event");
    Particle.publish("event", "data");
    Particle.publish("event", "data", 60);

    // Particle.subscribe()

    void (*handler1)(const char*, const char*) = nullptr;
    Particle.subscribe("event", handler1);

    std::function<void(const char*, const char*)> handler2;
    Particle.subscribe("event", handler2);

    struct Handler3 {
        void handler(const char*, const char*) {
        }
    } handler3;
    Particle.subscribe("event", &Handler3::handler, &handler3);
}

void loop() {
}

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation (N/A)
  • Added to CHANGELOG.md after merging (add links to docs and issues)

Deprecated API

[PR #1365] Beginning with 0.8.0 release, Particle.publish() and Particle.subscribe() methods will require event scope to be specified explicitly. Please update your apps now to include the event scope to avoid compilation errors in >=0.8.0

Generate deprecation warnings when Particle.publish() and Particle.su…
…bscribe() methods are invoked with default event scope

@sergeuz sergeuz added this to the 0.7.0 milestone Aug 8, 2017

@sergeuz sergeuz requested a review from technobly Aug 8, 2017

@technobly technobly merged commit 92c1beb into develop Aug 10, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@technobly technobly deleted the feature/deprecated_msg branch Aug 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.