1. 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
  2. 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
  3. Nov 17, 2021
  4. Nov 11, 2021
  5. Nov 09, 2021
  6. Nov 08, 2021
  7. Nov 01, 2021
  8. Oct 15, 2021
  9. Oct 12, 2021
  10. Oct 11, 2021
    • Niklas Adolfsson's avatar
      [http server]: use tokio::spawn internally in `HttpServer::start` and return `StopHandle` (#402) · 6fb61dc1
      Niklas Adolfsson authored
      
      
      * [ws server]: refactor start()
      
      * remove needless clone
      
      * fix http server too
      
      * fmt
      
      * unify stop APIs
      
      * fix bad merge
      
      * add API to use custom tokio runtime
      
      * use futures oneshot
      
      * fix unintentional change
      
      * Revert "use futures oneshot"
      
      This reverts commit 0432f6ba41d49a3494943458657a31f8afd79160.
      
      * Update http-server/src/server.rs
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      6fb61dc1
    • Maciej Hirsz's avatar
      Resource Limiting (#500) · 518a6155
      Maciej Hirsz authored
      
      
      * Squash post merge
      
      * RAII claims and some comments
      
      * Adding resources to Methods
      
      * Use arrays for claiming all resources at once
      
      * Register resources on ws-server
      
      * Return MethodResourcesBuilder from register_method
      
      * Return MethodResourcesBuilder from register_async_method
      
      * fmt and comments
      
      * Add `verify_and_insert` to get rid of `or_insert` in order to get mut ref to value
      
      * Resources initialization
      
      * No need for ResourceBuilder
      
      * Comment all the things
      
      * Handle errors on ws-server `start` method
      
      * Passing ResourceGuard to method execution
      
      * Start ws-server in background, simplify all the tests!
      
      * Claiming resources on runtime
      
      * Do checked math on resource claiming
      
      * Clearer error path for resources at limit
      
      * Resource limiting tests WIP
      
      * Unbox async futures
      
      * fmt
      
      * Cleaner proc macro
      
      * Fix lifetime issues with ResourceGuard with internal Arc
      
      * Remove unnecessary lifetime generic
      
      * Working tests
      
      * Use turbofish in tests
      
      * fmt
      
      * Fixed (?) benches
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Tweak more grumbles
      
      * Adding a test for resource limiting with proc macros (WIP)
      
      * Reworking attribute macros for resource limiting (#507)
      
      * Squashed macros WIP
      
      * bae-less macros!
      
      * Make things simpler and more readable
      
      * Some comments and DRY aliases parsing
      
      * Naming things is hard
      
      * Respan is no longer needed
      
      * Simpler Arguments
      
      * Remove stale code
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * syn-up all the things, handle resources on methods
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * Resource limiting on the http server
      
      * Test two resources at once
      
      * Test the HTTP server for resource limiting
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid <[email protected]>
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * Comment tweaks
      
      * More explicit error type for `AttributeMeta::retain`
      
      * Remove generic from ResourceTable; derive Default on ws Builder
      
      * Make the macros shorter
      
      Co-authored-by: default avatarDavid <[email protected]>
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      518a6155
  11. Sep 24, 2021
    • Niklas Adolfsson's avatar
      fix: ws server terminate subscriptions when connection is closed by the client. (#483) · 7cd7f36a
      Niklas Adolfsson authored
      * fix: server should not send to closed subscription
      
      Closing #481
      
      * add a test
      
      * rewrite me
      
      * remove faulty server close
      
      * fix tests
      
      * fix tests
      
      * remove needless code
      
      * Update ws-client/src/client.rs
      
      * fix: remove atomic flag; use `close_sender`
      
      * remove terminate message; use close channel
      
      * remove faulty subscription closed error msg
      
      * fix tests
      
      * fix grumbles
      
      * fix build
      7cd7f36a
  12. Sep 16, 2021
  13. Sep 15, 2021
    • David's avatar
      Rename and reorg types (#462) · 635142e3
      David authored
      * Renames
      
      * More renames
      
      * fmt
      
      * s/RpcParams/Params/
      
      * Add a type alias `SubscriptionResponse` to `Notification` which is parametrized to `SubscriptionPayload`
      Move `SubscriptionResponse` to the `response` module
      
      * Fix doc links
      
      * Cleanup and some docs
      
      * Review feedback
      
      * cleanup
      635142e3
  14. Sep 14, 2021
    • David's avatar
      Fix build warnings (#465) · c13f97ba
      David authored
      * Silence warning on cors_max_age
      
      * Revert change to `AccessControl`
      c13f97ba
    • Maciej Hirsz's avatar
      Reject overflowing connection with status code 429 (#456) · bf2fff04
      Maciej Hirsz authored
      * Reject overflowing connection with status code 429
      
      * fmt
      
      * rename Handshake -> HandshakeMode for clarity; verbose test
      
      * Gracefully shutdown after rejecting to hopefully fix the errors on windows
      
      * HandshakeMode -> HandshakeResponse; tweak pending subscriptions on shutdown test
      bf2fff04
  15. Sep 11, 2021
  16. Sep 01, 2021
    • Maciej Hirsz's avatar
      Tidy `StopHandle` (#425) · ffa504e2
      Maciej Hirsz authored
      
      
      * Experimental generic driver for methods
      
      * Move FutureDriver to its own module
      
      * "Infallible" sync methods + fmt
      
      * Drive all methods to completion before background_task closes
      
      * Testing a different stop handle
      
      * Added the waker for the monitors
      
      * Fix the test
      
      * Fix a possible deadlock
      
      * fmt
      
      * Explain strong_count check in StopHandle Drop impl
      
      * Clippy tweak
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * Added comment on atomicbool ordering
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      ffa504e2
  17. Aug 25, 2021
  18. Aug 17, 2021
    • Maciej Hirsz's avatar
      Concurrent polling on async methods (#424) · c69e0dd8
      Maciej Hirsz authored
      * Experimental generic driver for methods
      
      * Move FutureDriver to its own module
      
      * "Infallible" sync methods + fmt
      
      * Drive all methods to completion before background_task closes
      c69e0dd8
  19. Aug 13, 2021
  20. Jul 12, 2021
    • Maciej Hirsz's avatar
      Module API refactor (#412) · 8db65b42
      Maciej Hirsz authored
      
      
      * Do not register methods on servers
      
      * fmt
      
      * Infallible `to_rpc` proc macro
      
      * Remove dead code
      
      * Check for duplicate names at compile time
      
      * Add a UI test for name conflicts
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      Co-authored-by: default avatarDavid Palm <[email protected]>
      8db65b42
    • David's avatar
      Rexport types for servers (#409) · 0592442e
      David authored
      * Include "macros" in the "server" feature
      
      * Re-export SubscriptionSink
      
      * Include the "types" feature in both the "client" and "server" features
      Export types::* from façade when the "types" is active
      Export types::* from servers
      
      * fmt
      
      * Export jsonrpsee_types under types
      
      * fmt
      
      * broken doc link
      
      * fix benches
      
      * fmt
      
      * Fix test imports
      0592442e
  21. Jul 01, 2021
  22. Jun 30, 2021
    • Maciej Hirsz's avatar
      Synchronization-less async connections in ws-server (#388) · 7496afe2
      Maciej Hirsz authored
      * WIP
      
      * More WIP
      
      * Simplify ConnDriver
      
      * Progress all connections on each poll
      
      * Make ConnDriver more opaque and less leaky
      
      * fmt
      
      * Spawn connections on tasks after handshake
      
      * WIP put connections on tasks
      
      * cargo fmt, naming clarity
      
      * Fix grumbles
      
      * Extra comment on swap_remove
      
      * Remove unwrap from the handshake
      
      * Restore the wrapping_add on connection id
      7496afe2
    • Niklas Adolfsson's avatar
      [ws server]: terminate already established connection(s) when the server is stopped (#396) · 7a33bf50
      Niklas Adolfsson authored
      
      
      * [ws server]: terminate connection when closed.
      
      * fix tests
      
      * add test
      
      * address grumbles: return Ok when server stopped
      
      * revert log
      
      * revert outdated documentation
      
      * use wrapping add for conn id
      
      * address grumbles: replace Mutex with AtomicBool
      
      * add comment to assertion
      
      * fix nits
      
      * address grumbles: naming of variables
      
      * address grumbles: RwLock to wait for tasks
      
      This commit introduces a RwLock instead of the Mutex to the shared by the background tasks
      and the stop handle won't signal until all readers has been dropped.
      
      * fix nit
      
      * Update ws-server/src/server.rs
      
      * remove AtomicBool; use stop_sender instead
      
      * Update ws-server/src/server.rs
      
      * Update ws-server/src/server.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * correct subscription err messages
      
      Co-authored-by: default avatarDavid <[email protected]>
      7a33bf50
  23. Jun 24, 2021
  24. Jun 18, 2021
  25. Jun 10, 2021
  26. Jun 03, 2021
    • David's avatar
      Add a builder to the ws server (#365) · fa1f9e0e
      David authored
      * Add a builder to the ws server
      
      * Use the WsServerBuilder in tests&examples
      
      * cleanup
      
      * fmt
      
      * Fix benches
      
      * fix error message
      
      * Add connection count limiting and associated config item
      
      * Use the strong_count to `methods` to know how many connections we currently have
      
      * Fix test
      fa1f9e0e
  27. Jun 02, 2021
  28. Jun 01, 2021
    • Igor Aleksanov's avatar
      Basic support for async methods (#327) · 2da9244b
      Igor Aleksanov authored
      
      
      * Add basic support for async methods
      
      * Add support of async methods into ws server
      
      * Add support of async methods to HTTP server
      
      * Fix subscriptions method lookup
      
      * Remove type that appeared to be unused
      
      * Add comment on safety of unwrap in OwnedJsonRpcRequest::borrowed
      
      * Update utils/src/server/rpc_module.rs
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      2da9244b
    • David's avatar
      Unify RpcModule types (#350) · c2c66e1a
      David authored
      
      
      * Remove register_* from Server
      
      * Tests pass
      
      * Some cleanup
      
      * more cleanup
      
      * Less bounds
      
      * Remove the `RpcMethod` trait – I don't think we need it.
      
      * fmt
      
      * Fix benches
      
      * Enable merging two modules with different contexts
      
      * Module registration returns number of methods on the server and checks for dupes
      Tests for module registration and some cleanup
      
      * Export `RpcModule` from façade crate
      fmt
      
      * Revert to return error from `Server::register_module`
      
      * Remove Server::methods
      
      * Remove TODO
      
      * Fix tests
      Fix http server to work the same as ws-server
      
      * Server::method_names
      
      * fmt
      
      * fix clippy warnings
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      c2c66e1a
  29. May 28, 2021
  30. May 24, 2021