Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: Add a subscription manager. The idea is to use the `Subscriptions` struct from Substrate, which is used to drive subscription futures to completion, and modify it for "general" use. * Allow IdProvider::Id and SubscriptionId to work together Adds trait bounds that allow conversion between the two, removing the need for generics in SubscriptionId. * Update SubscriptionId tests * Rustfmt * Use `SubscriptionId` as the key for `active_subscriptions` * Add subscription ID providers. Adds two subscription ID providers which can be used by the SubscriptionManager. One provides a simple numeric ID, while the other provides a random string. * Add some documentation * Clean up comment and naming * Change the NumericIdProvider to use `u64` IDs Instead of providing a guarantee that we can convert between `usize` and `u64` we make the assumptions that it's unlikely that we're running on an architecture larger than 64-bits and we use a `u64` directly. * Add tests for IdProvider and SubscriptionManager Note: There's one test that doesn't pass yet which has to do with the `cancel()` function of the SubscriptionManager. * Restore RandomStringIdProvider as the default provider * Retain receiver.: * Make test executor a lazy static * Rustfmt * Add a comment to test * Remove `matches!` macro Our Windows CI runner isn't up to date and thinks this is still a nightly feature Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
- Loading branch information