Skip to content

PubSub #380

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

Merged
merged 7 commits into from
Mar 11, 2020
Merged

PubSub #380

merged 7 commits into from
Mar 11, 2020

Conversation

MartinKavik
Copy link
Member

Resolves #130
Resolves #131

Changes

  • Added methods subscribe, subscribe_with_handle, perform_cmd_with_handle, stream, stream_with_handle and notify into Orders (perform_cmd and Cancellation #130).
    • See comments for these methods in orders.rs.
    • They are demonstrated in the example subscribe.
    • You can stop stream / unsubscribe / cancel command by dropping its handle.
    • They should replace routes, window_events, sink and GMsg (they are not deprecated yet).
  • Added cmds::timeout, stream::interval, stream::window_event, subs::UrlChanged and subs::UrlRequested (Easy timeout/setInterval #131).
  • Added example subscribe.
  • Updated example todomvc to use subscription UrlChanged instead of routes.
  • [BREAKING] Futures in perform_cmd and perform_g_cmd are executed immediately.
    • It doesn't make sense to have it in the queue. Only output of send_msg(..) and notify(..) is pushed into the queue to prevent recursion and stack overflow in the update function.
  • Added App methods notify and notify_with_notification.
  • [BREAKING] App method process_cmd_and_msg_queue renamed to process_effect_queue.
  • [BREAKING] Url change listeners are always active (even if routes is not defined).
    • To fire UrlChanged and UrlRequested notifications and to behave consistently.
  • Added cmds, streams, subs, CmdHandle, SubHandle and StreamHandle into the Seed's prelude.
  • [BREAKING] Removed module next_tick.
    • It was used internally to prevent potential stack overflow during spawn_local call, but it looks that it has been changed in the wasm_bindgen_futures - The future will always be run on the next microtask tick even if it immediately returns Poll::Ready. And tests that should check it pass so it should be ok. I assume that users don't use it, but it was probably available from the public API, so it's breaking change.

@MartinKavik MartinKavik modified the milestones: 2. Stable basic Seed API, 0.7.0 Mar 9, 2020
@MartinKavik MartinKavik added NEXT RELEASE enhancement New feature or request labels Mar 9, 2020
@MartinKavik MartinKavik merged commit b002082 into seed-rs:master Mar 11, 2020
@theduke
Copy link

theduke commented Mar 11, 2020

Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Easy timeout/setInterval perform_cmd and Cancellation
2 participants