1. 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
  2. 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
  3. Sep 16, 2021
  4. 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
  5. 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
  6. Sep 11, 2021
  7. 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
  8. Aug 25, 2021
  9. 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
  10. Aug 13, 2021
  11. 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
  12. Jul 01, 2021
  13. 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
  14. Jun 24, 2021
  15. Jun 18, 2021
  16. Jun 10, 2021
  17. 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
  18. Jun 02, 2021
  19. 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
  20. May 28, 2021
  21. May 24, 2021
  22. May 19, 2021
    • Niklas Adolfsson's avatar
      [types]: ID type instead of serde_json::RawValue (#325) · 4e95f436
      Niklas Adolfsson authored
      * get started
      
      * add additional test
      
      * fix nits
      
      * cargo fmt
      
      * [types]: write some tests.
      
      * [http server]: send empty response on notifs
      
      * [http server]: fix tests
      
      * [rpc module]: send subscription response
      
      * Update types/src/v2/error.rs
      
      * fix nits
      
      * cargo fmt
      
      * Update types/src/v2/params.rs
      
      * remove needless clone
      
      * remove dead code
      
      * [types]: impl PartialEq for JsonErrorObject + test
      
      * use beef::Cow
      
      * Update http-server/src/tests.rs
      4e95f436
  23. May 18, 2021
  24. May 14, 2021
  25. May 12, 2021
  26. May 07, 2021
  27. May 04, 2021
    • Niklas Adolfsson's avatar
      [servers] return error if context or params fails (#295) · b51abeca
      Niklas Adolfsson authored
      * ret err if context/params fails
      
      * address grumbles: specific error_code context fail
      
      * address grumbles: make env_logger dev-dependency
      
      * address grumbles: add tests
      
      * chore(deps): remove unused deps
      
      * address grumbles: rename types and docs
      
      * address grumbles: more renaming.
      
      * fix build
      b51abeca
  28. Apr 28, 2021
  29. Apr 26, 2021
    • Niklas Adolfsson's avatar
      [types]: allow `data` field in jsonrpc error obj. (#286) · 187ee5e9
      Niklas Adolfsson authored
      * [types]: allow `data` field in jsonrpc error obj.
      
      * fmt
      
      * revert change to make fail
      
      * remove redundant test
      
      * [types]: bring back `data` and `message` in error.
      
      Basically deducing the error message from server defined error doesn't work
      and we should not strip out this information from to user which might be useful.
      
      * remove boiler plate code
      
      * [types]: impl From<ErrorCode> for JsonRpcError
      
      * address grumbles
      
      * remove more boiler plate
      187ee5e9
  30. Apr 21, 2021
  31. Apr 20, 2021
    • Niklas Adolfsson's avatar
      [client] use types v2 (less alloc) (#269) · 31153ac7
      Niklas Adolfsson authored
      * rewrite me
      
      * v2
      
      * PoC works without batch request
      
      * remove `PartialEq` bounds
      
      * add naive benches types
      
      * misc
      
      * remove useless lifetime
      
      * [ws client]: move request ID generation to client
      
      * make tests compile again
      
      * [client transport]: kill leaky abstractions.
      
      * [http client transport]: minor changes in the API.
      
      * [ws client]: fix batch requests.
      
      * fix nits
      
      * [ws client]: generate two request IDs for subscrib
      
      * fix tests
      
      * remove unused types + less alloc for params.
      
      * fix nits
      
      * more tweaks.
      
      * remove unused code
      
      * fix more nits
      
      * remove unused legacy types
      
      * reorg types_v2 mod
      
      * port macros to new types
      
      * fix tests again; more jsonvalue
      
      * [proc macros]: bring back impl Into for params.
      
      * fix build
      
      * [proc macros]: make it work for external crates.
      
      * [types]: remove weird From<Option<T>> to impl.
      
      * cleanup again
      
      * [examples]: remove unused async-std dep
      
      * Update types/src/v2/mod.rs
      
      * [types]: remove unsed dep smallvec
      
      * rewrite me
      
      * [types]: error code impl ser/deser
      
      Manual implementation of serialize/deserialize to get rid of duplicated message string
      
      * [types v2]: re-org with explicit mods
      
      * fix faulty test
      
      * add missed files
      
      * [ws client]: req_manager reserve unsubscribe slot.
      
      * simplify test code
      
      * add tracking issue for TODO
      
      * remove unused deps
      31153ac7
  32. Apr 12, 2021