1. Jun 24, 2022
  2. Jun 22, 2022
  3. Jun 21, 2022
  4. Jun 20, 2022
  5. Jun 17, 2022
  6. Jun 14, 2022
  7. Jun 13, 2022
  8. May 19, 2022
  9. May 03, 2022
  10. Apr 29, 2022
    • Niklas Adolfsson's avatar
      fix(rpc module): close subscription task when a subscription is `unsubscribed`... · 8e945de4
      Niklas Adolfsson authored
      fix(rpc module): close subscription task when a subscription is `unsubscribed` via the `unsubscribe call` (#743)
      
      * refactor: remove SubscriptionSink::inner_send
      
      * fix: close running task if unsubscribed
      
      * Update core/src/server/rpc_module.rs
      
      * Update core/src/server/rpc_module.rs
      
      * fix nits
      
      * Update core/src/server/rpc_module.rs
      
      * add test for canceling subscriptions
      
      * print subscription info; once per minute
      
      * revert closure stuff
      
      * Revert "print subscription info; once per minute"
      
      This reverts commit 366176a8
      
      .
      
      * use tokio::sync::watch instead of oneshot
      
      The receiver is clonable and it's possible to check whether the sender is still alive
      
      * Update tests/tests/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update core/src/server/rpc_module.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * grumbles: use unwrap in tests
      
      * add test for reuse pipe_from_stream
      
      Co-authored-by: default avatarDavid <[email protected]>
      8e945de4
  11. Apr 20, 2022
  12. Apr 05, 2022
  13. Apr 01, 2022
    • Niklas Adolfsson's avatar
      feat: add `SubscriptionSink::pipe_from_try_stream` to support streams that returns `Result` (#720) · 545ceaf6
      Niklas Adolfsson authored
      
      
      * refactor: make `pipe_from_stream` take stream of result
      
      The rationale for this is that it is more flexible for use cases when `Stream<Item = Result<T, Error>>`.
      
      Take for example `tokio_stream::Broadcast` then one would have to something like:
      
      ```rust
         let stream = BroadcastStream::new(rx).take_while(|r| future::ready(r.is_ok())).filter_map(|r| future::ready(r.ok()));
      ```
      
      Of course it's a bit awkward to return `Result` when the underlying stream can't fail but I think that's fair trade-off
      here.
      
      * Update core/src/server/rpc_module.rs
      
      Co-authored-by: default avatarTarik Gul <[email protected]>
      
      * pipe_from_stream: make E: Display instead of StdError
      
      * add a test
      
      * add `pipe_from_try_stream` API to support `TryStream`
      
      * Update tests/tests/integration_tests.rs
      
      * Update proc-macros/src/lib.rs
      
      Co-authored-by: default avatarTarik Gul <[email protected]>
      545ceaf6
  14. Mar 30, 2022
  15. Mar 09, 2022
  16. Feb 22, 2022
  17. Jan 21, 2022
    • David's avatar
      Add a method to RpcModule that transforms the module into a `RpcModule<()>`,... · c0f343d4
      David authored
      
      Add a method to RpcModule that transforms the module into a `RpcModule<()>`, i.e. removes the context. (#660)
      
      * Add a method to RpcModule, `decontextualize`, that transforms the module into a `RpcModule<()>`, i.e. removes the context.
      
      * Merging a module with an empty module cannot fail
      
      * fmt
      
      * Address grumbles
      
      * Cleanup macro
      
      * Update core/src/server/rpc_module.rs
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      c0f343d4
    • Niklas Adolfsson's avatar
      feat(rpc module): `stream API` for SubscriptionSink (#639) · 9bd21274
      Niklas Adolfsson authored
      
      
      * feat(rpc module): add_stream to subscription sink
      
      * fix some nits
      
      * unify parameters to rpc methods
      
      * Update core/src/server/rpc_module.rs
      
      * Update tests/tests/integration_tests.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * address grumbles
      
      * fix subscription tests
      
      * new type for `SubscriptionCallback` and glue code
      
      * remove unsed code
      
      * remove todo
      
      * add missing feature tokio/macros
      
      * make `add_stream` cancel-safe
      
      * rename add_stream and return status
      
      * fix nits
      
      * rename stream API -> streamify
      
      * Update core/src/server/rpc_module.rs
      
      * provide proper close reason
      
      * spelling
      
      * consume_and_streamify + docs
      
      * fmt
      
      * rename API pipe_from_stream
      
      * improve logging; indicate which subscription method that failed
      
      Co-authored-by: default avatarDavid <[email protected]>
      9bd21274
  18. Dec 21, 2021
    • Niklas Adolfsson's avatar
      feat: server configurable subscriptionID (#604) · bc688cc2
      Niklas Adolfsson authored
      
      
      * PoC
      
      * introduce IdProvider trait
      
      * revert Cow stuff
      
      * Update ws-server/src/server.rs
      
      * fix tests
      
      * cargo fmt
      
      * use 'static lifetime in SubscriptionId
      
      * fix tests
      
      * fmt
      
      * make tests compile again
      
      * fix tests
      
      * Fix tests
      
      * Move IdProvider impls to own module
      
      * move `sub-id gen` types to `core`
      
      * fix doc links
      
      * make rand non-optional dep
      
      * feature gate: id provider
      
      Co-authored-by: default avatarDavid Palm <[email protected]>
      bc688cc2
  19. Dec 17, 2021
    • Maciej Hirsz's avatar
      Crate restructuring (#590) · e159c449
      Maciej Hirsz authored
      
      
      * Nuke V2
      
      * fmt
      
      * Formatting and imports
      
      * Updated benches
      
      * Fix doc comment link
      
      * Brace imports in ws-server
      
      * Reworking imports
      
      * std first
      
      * fmt
      
      * std on top
      
      * Update to match changed line numbers
      
      * Rename jsonrpsee_utils -> jsonrpsee_core
      
      * Migrating things types -> core
      
      * RpcError -> ErrorResponse
      
      * Merge types::client into core::client
      
      * Continued move types -> core
      
      * Removing features to make checks pass
      
      * Move rpc_module tests to tests crate
      
      * Fixed doc comment links
      
      * Add futures-util dependency for client
      
      * Remove dead code
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * fmt
      
      * Feature gate the Client trait
      
      * Move `Client` traits to `client` module
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      e159c449
  20. Dec 15, 2021
    • Niklas Adolfsson's avatar
      refactor `SubscriptionClosed` (#612) · c480d90a
      Niklas Adolfsson authored
      
      
      * refactor `SubscriptionClosed`
      
      I noticed that we "trying" to sending "close messages" on subscriptions
      that already has been terminated by the client which is unnecessary.
      
      Moreover, this introduces `fn is_closed` to check whether a given
      channel is closed without having to send an actual message on the channel.
      
      * cargo fmt
      
      * Update types/src/error.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * fix nits
      
      * more grumbles
      
      * make rust stable happy
      
      * SubscriptionClosed: add deny unknown fields
      
      Co-authored-by: default avatarDavid <[email protected]>
      c480d90a
  21. Dec 10, 2021
  22. Dec 06, 2021
  23. Dec 01, 2021
    • Maciej Hirsz's avatar
      Middleware for metrics (#576) · 1657e26b
      Maciej Hirsz authored
      
      
      * Squashed MethodSink
      
      * Middleware WIP
      
      * Passing all the information through
      
      * Unnecessary `false`
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Add a setter for middleware (#577)
      
      * Fix try-build tests
      
      * Add a middleware setter and an example
      
      * Actually add the example
      
      * Grumbles
      
      * Use an atomic
      
      * Set middleware with a constructor instead
      
      * Resolve a todo
      
      * Update ws-server/src/server.rs
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      * Update ws-server/src/server.rs
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      * Update ws-server/src/server.rs
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      * Middleware::on_response for batches
      
      * Middleware in HTTP
      
      * fmt
      
      * Server builder for HTTP
      
      * Use actual time in the example
      
      * HTTP example
      
      * Middleware to capture method not found calls
      
      * An example of adding multiple middlewares. (#581)
      
      * Add an example of adding multiple middlewares.
      
      * Update examples/multi-middleware.rs
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      * Update examples/Cargo.toml
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      * Move `Middleware` to jsonrpsee-types (#582)
      
      * Move `Middleware` to jsonrpsee-types
      
      * Move Middleware trait to jsonrpsee-types
      
      * Add some docs.
      
      * Link middleware to `with_middleware` methods in docs
      
      * Doctests
      
      * Doc comment fixed
      
      * Clean up a TODO
      
      * Switch back to `set_middleware`
      
      * fmt
      
      * Tests
      
      * Add `on_connect` and `on_disconnect`
      
      * Add note to future selves
      
      Co-authored-by: default avatarDavid <[email protected]>
      1657e26b