- Oct 12, 2021
-
-
Maciej Hirsz authored
* Document resource limiting * Formatting * More formatting * fmt * Doc comment wording Co-authored-by: David <[email protected]> * Cross-reference docs between servers and utils * Fix grumbles * More elaborate description * Update http-server/Cargo.toml Co-authored-by: Niklas Adolfsson <[email protected]> * Apply suggestions from code review Co-authored-by: David <[email protected]> * Allow for unlimited resources if cap is 0 * fmt * Update ws-server/Cargo.toml Co-authored-by: Niklas Adolfsson <[email protected]> * Clarify 8 resources, 0s in costs/limits, and runtime errors Co-authored-by: David <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
-
- Oct 11, 2021
-
-
Niklas Adolfsson authored
Closing #485
-
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: David <[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: Niklas Adolfsson <[email protected]> * syn-up all the things, handle resources on methods Co-authored-by: Niklas 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: David <[email protected]> Co-authored-by: Niklas 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: David <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
-
- Oct 01, 2021
-
-
Maciej Hirsz authored
* Unbox async futures * fmt * Cleaner proc macro * Remove unnecessary parens around async blocks
-
- Sep 29, 2021
-
-
Niklas Adolfsson authored
-
- Sep 24, 2021
-
-
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
-
- Sep 16, 2021
-
-
David authored
* Re-export v2::params, error, request and response types * Use shallow type paths
-
- Sep 15, 2021
-
-
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
-
- Sep 14, 2021
-
-
David authored
* Add a test illustrating how to use the `call` convenience method * Extend test + review feedback * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * Add Methods::test_subscription Log more when params parsing fails * Add call_with test helper (ty @niklas!) + cleanup * Remove todo (part of https://github.com/paritytech/jsonrpsee/issues/457 ) * fmt * Let `test_subscription` be called from other crates * Manually fix indentation * fmt * SSself-review grumbles * CallError::InvalidParams carries an anyhow::Error * fmt * Tweak docs * Update utils/src/server/rpc_module.rs Co-authored-by: Niklas Adolfsson <[email protected]> * review grumble * Fix todos * fmt * Fixup error messages * Include source in the error message for `CallError` * fmt * Update proc-macros/src/render_server.rs Co-authored-by: Maciej Hirsz <[email protected]> * Mention needing jsonrpsee crate in scope * Resolve todo * Impl ToRpcParams for 0-sized array * optimized logging Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]>
-
- Sep 13, 2021
-
-
Niklas Adolfsson authored
* new helper for testing * fix features * call_with_params -> call_with * call_with_params -> call_with * Update utils/src/server/rpc_module.rs * fix trait bound * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * call_with -> test_call * fix grumbles * fix nits Co-authored-by: David <[email protected]>
-
- Aug 25, 2021
-
-
David authored
* Add license headers where missing and update year * Update examples/http.rs Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
-
- Aug 18, 2021
-
-
Niklas Adolfsson authored
* rewrite me * require proc macro API to return result * send unknown message when error is not CallError * show example that auto cast StdError doesn't work * register_*_method Into<Error> * clippy * replace generic errors with anyhow::Error * fix nits * example that anyhow::Error in register_method works * CallError: add missing From impl * [types]: add helper methods for Error types The rationale is to make it possible for users to either use anyhow::Error or use the helper methods. * fmt * Revert "register_*_method Into<Error>" This reverts commit 33b4fa28730b72647ba150659d3c0ab1937e524a. * add better comment * fix nit
-
- Aug 17, 2021
-
-
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
-
- Aug 13, 2021
-
-
Niklas Adolfsson authored
-
- Jul 27, 2021
-
-
Maciej Hirsz authored
* WIP * Feature-complete-ish * WIP * Cleaner replace marker * Inject lifetimes in elided `Cow`s * Use a single static &str for all injected lifetimes * Working lifetimes * Add the `call` method to `Methods` * Testing proc macro with optional params * Remove internal loop * fmt * Fix grumbles
-
- Jul 12, 2021
-
-
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: David <[email protected]> Co-authored-by: David Palm <[email protected]>
-
- Jul 10, 2021
-
-
David authored
* Pass OwnedRpcParams to async methods * Cow-ified RpcParams * fmt * Separate `RpcParamsSequence` parser from `RpcParams` * Remove OwnedId, use Id<'static> instead * Ensure that parsed `Id` is borrowing from input slice * Tweak/add some docs Test that parse() works after calling sequence() * Fix rustdoc link Co-authored-by: Maciej Hirsz <[email protected]>
-
- Jul 01, 2021
-
-
Maciej Hirsz authored
* Streaming RpcParams parsing * DRY RpcParams::one again * Fix doc comments
-
- Jun 30, 2021
-
-
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: David <[email protected]> * correct subscription err messages Co-authored-by: David <[email protected]>
-
- Jun 29, 2021
-
-
Niklas Adolfsson authored
* feat: customizable error via RpcError trait This commit introduces a new trait for defining user customizable error codes and messages * revert trait stuff * use RawValue * fix docs * rexport to_json_raw_value
-
- Jun 24, 2021
-
-
Niklas Adolfsson authored
* [jsonrpsee types]: unify types + more tests * address grumbles
-
- Jun 18, 2021
-
-
Maciej Hirsz authored
* Make sync methods into Arc pointers * impl Clone for RpcModule and Methods * No need to wrap Methods in Arc anymore * Simplify generics * register_alias * fmt * grammar Co-authored-by: James Wilson <[email protected]> * Use a separate Arc counter for tracking max_connections Co-authored-by: James Wilson <[email protected]>
-
- Jun 04, 2021
-
-
Niklas Adolfsson authored
* [rpc module]: server-side close subscription Add functionality that closes the subscription after the sink has been dropped. * [integration tests]: add timeout on futures * remove global subscriber mutex * fix nit * [client types]: fix #349 Subscription::next() propogate error when parsing the response fails * [client types]: fix #349 Subscription::next() propogate error when parsing the response fails * unify subscription and notification * rename again * send notif response when subscription is dropped * stray debug stuff * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Revert "[client types]: fix #349" This reverts commit c4fefade719ebd8c964a62d0eb16f89db3346ccd. * Revert "[integration tests]: add timeout on futures" This reverts commit 21dfb99649aaaa8c847a693b4510e0202498fa2c. * show that actual edge-case * fix nit * Update types/src/traits.rs * fix bad merge * ugly; but works * complete solution * get rid of Option * Update tests/tests/integration_tests.rs * Update utils/src/server/rpc_module.rs * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * grumbles: fix faulty early return * remove weird abstraction KeepAlive * fix nits * revert test timeouts * address grumbles * fix build Co-authored-by: David <[email protected]>
-
- Jun 02, 2021
-
-
David authored
* Fix debug impl for MethodCallback * Prefer derive * fmt
-
Maciej Hirsz authored
* Use a single map for methods * fmt * cargo fmt screwed indents somehow * Use Arc instead of Box for async methods * fmt * Implement `execute` on `MethodCallback` to keep things DRY * fmt * `OwnedJsonRpcRequest` is not necessary anymore * Call `execute` on `Methods` directly for even more DRY code * Update utils/src/server/rpc_module.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Use `copied` instead of mapping a deref * DRY-er `params` in `MethodCallback` * Added comment on `0` conn_id in http Co-authored-by: Niklas Adolfsson <[email protected]>
-
Igor Aleksanov authored
* Enable docs/debug/pub warnings for server and types crates * Remove Debug bound on Notif * Stick to deriving debug * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]>
-
David authored
* Misc async methods tinkerings * Update utils/src/server/rpc_module.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Update types/src/v2/params.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Fix review grumbles * fmt Co-authored-by: Niklas Adolfsson <[email protected]>
-
- Jun 01, 2021
-
-
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: Niklas Adolfsson <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
-
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: Niklas Adolfsson <[email protected]>
-
- May 28, 2021
-
-
Niklas Adolfsson authored
* [ws server]: draft SubscriptionSinkWithParams * rexport types * PoC design2 * improve example * Update ws-server/src/server.rs Co-authored-by: David <[email protected]> * Subscription example (#324) * Add a test for calling methods with multiple params of multiple types (#308) * Add a test for calling methods with multiple params of multiple types * cargo fmt Co-authored-by: Niklas Adolfsson <[email protected]> * [ws client] RegisterNotification support (#303) * Rename NotifResponse to SubscriptionResponse to make room for new impl * Add support for on_notification Subscription<T> types * Fix handling of NotificationHandler in manager * cleanup * Implement NotificationHandler to replace Subscription<T> and clean up plumbing * More cleanup * impl Drop for NotificationHandler * Address pr feedback #1 * ws client register_notification pr feedback 2 * Fix doc * fix typo * Add tests, get NH working * More cleanup of String/&str * fix doc * Drop notification handler on send_back_sink error * ws client notification auto unsubscribe when channel full test * Change order of type params to register_method (#312) * Change order of type params to register_method * Cleanup and fmt * Update ws-server/src/tests.rs Co-authored-by: Niklas Adolfsson <[email protected]> * CI: optimize caching (#317) * Bump actions/checkout from 2 to 2.3.4 (#315) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.3.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v2.3.4 ) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions-rs/cargo from 1 to 1.0.3 (#314) Bumps [actions-rs/cargo](https://github.com/actions-rs/cargo) from 1 to 1.0.3. - [Release notes](https://github.com/actions-rs/cargo/releases) - [Changelog](https://github.com/actions-rs/cargo/blob/master/CHANGELOG.md) - [Commits](https://github.com/actions-rs/cargo/compare/v1...v1.0.3 ) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions-rs/toolchain from 1 to 1.0.7 (#313) Bumps [actions-rs/toolchain](https://github.com/actions-rs/toolchain) from 1 to 1.0.7. - [Release notes](https://github.com/actions-rs/toolchain/releases) - [Changelog](https://github.com/actions-rs/toolchain/blob/master/CHANGELOG.md) - [Commits](https://github.com/actions-rs/toolchain/compare/v1...v1.0.7 ) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [ws server]: add logs (#319) * WIP - hangs * fix example * cleanup * Add certificate_store() to WsClientBuilder (#321) * Add custom_certificate to WsClientBuilder * Use system certs instead of specified file * Cache client_config * Move client_config logic to fn build * Default use_system_certificates to true * Move out connector * Add CertificateStore type * cargo fmt * cargo clippy * Resolve comment: Rename variable * Resolved comments Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Billy Lindeman <[email protected]> Co-authored-by: Denis Pisarev <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Albin Hedman <[email protected]> * grumbles: impl maciej proposal * fix test build * add test for subscription with param * cargo fmt * Update examples/ws_subscription.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * grumbles * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: Maciej Hirsz <[email protected]> * fix more grumbles * [subscriptionSink]: introduce into_sinks * use replace * fix more nits * maciej design 2 * fix tests * remove log * [rpc context mod]: register_subscription with ctx * nits * nits again * move subscribers mutex * clippy * [ws subscribe]: avoid send message on unsubscribed * revert unintentional changes * Subscription with context example (#345) * Add weather example to show how to use subscriptions with context * Add note * Cleanup * Additional cleanup (#347) * Add weather example to show how to use subscriptions with context * Add note * Cleanup * fmt * Cleanup and docs * fmt * ignore error on subscription Co-authored-by: David Palm <[email protected]> Co-authored-by: Billy Lindeman <[email protected]> Co-authored-by: Denis Pisarev <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Albin Hedman <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]>
-
- May 24, 2021
-
-
David authored
* Switch from anyhow::Result to std Result * fmt * Use thiserror `#[from]` * Remove sadness
-
- May 21, 2021
-
-
David authored
* Impl Deref/DerefMut for RpcContextModule Small QoL improvement. * Update utils/src/server/rpc_module.rs Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
-
- May 19, 2021
-
-
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
-
- May 18, 2021
-
-
Niklas Adolfsson authored
* [rpc server]: extract rpc_module to utils. This commit extracts the `rpc_module` from the servers to be shared. It will help to re-use rpc modules within both the servers * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/mod.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * address grumbles * fix build * fix docs * cargo fmt * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * grumbles: use MethodSink * Update utils/src/server/mod.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]>
-
- May 12, 2021
-
-
David authored
* Change order of type params to register_method * Cleanup and fmt * Update ws-server/src/tests.rs Co-authored-by: Niklas Adolfsson <[email protected]>
-
- May 07, 2021
-
-
David authored
* Batch requests over the websocket * Use same call signature for both http and ws server * Use CallError instead of InvalidParams Add a draft batch request test * Sort out formatting of batch responses Cleanup Use CallError * Add test for slow method calls * Update utils/src/server.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Add benchmark for batched websocket requests * rename * Rename batch channels * Sort out the InvalidParams situation * Remove one level of InvalidParams Return app-level error when call fails * Update ws-server/src/server.rs Co-authored-by: Andrew Plaza <[email protected]> * Update ws-server/src/server.rs Co-authored-by: Andrew Plaza <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Andrew Plaza <[email protected]>
-
- May 04, 2021
-
-
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
-
- Apr 28, 2021
-
-
Niklas Adolfsson authored
-
- Apr 20, 2021
-
-
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
-
- Apr 12, 2021
-
-
Niklas Adolfsson authored
-