- Nov 21, 2021
-
-
Alexandru Vasile authored
* proc-macros: Fix documentation typo of `rpc_identifier` * proc-macros: Support deprecated methods for rpc client (#564) Calling a deprecated method of the RPC client should warn the user at compile-time. Extract the `#[deprecated]` macro as is while parsing the RpcMethod, and pass through the macro to the RPC client rendering. * tests/ui: Check deprecated method for rpc client (#564) To ensure that the test will fail during compilation, warnings are denied. Check that the deprecate macro will generate warnings just for the methods that are utilized.
-
- Nov 19, 2021
-
-
Niklas Adolfsson authored
* feat: override `method` subscription notif * Arrow syntax for overwrites (#569) * check that unique notifs are used * check that custom sub name is unique * cargo fmt * address grumbles * Update proc-macros/src/rpc_macro.rs * commit added tests * Update proc-macros/src/render_server.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/render_server.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/rpc_macro.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/rpc_macro.rs Co-authored-by: David <[email protected]> * Update utils/src/server/rpc_module.rs Co-authored-by: David <[email protected]> * grumbles * fix long lines * 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 proc-macros/src/rpc_macro.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/render_server.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/render_server.rs Co-authored-by: David <[email protected]> * more grumbles Co-authored-by: Maciej Hirsz <[email protected]> Co-authored-by: David <[email protected]>
-
- Nov 11, 2021
-
-
Maciej Hirsz authored
* Fix some clippy issues * Add an interval to periodically wake the SelectDriver Waker * Apply suggestions from code review Co-authored-by: David <[email protected]> * Naming grumbles Co-authored-by: David <[email protected]>
-
Maciej Hirsz authored
* Array syntax aliases * fmt
-
- Nov 10, 2021
-
-
Maciej Hirsz authored
-
- Nov 03, 2021
-
-
¯\_(ツ)_/¯ authored
* feat(proc_macro): add support for map arguments * feat(proc_macro): formatting * feat(proc_macro): fix issues with Into trait * feat(proc_macro): param_format for methods * feat(proc_macro): improve param_format checking - Addressed @niklasad1 's suggestion to use an Option instead of just defaulting to "array". * feat(proc_macro): apply suggestions, add test case - Use enum for param format. - Extract parsing logic into separate function. - Add ui test. * feat(proc_macro): run cargo fmt * feat(proc_macro): address suggestions * feat(proc_macro): document param_kind argument * feat(proc_macro): consistent spacing Apply @maciejhirsz formatting suggestion. Co-authored-by: Maciej Hirsz <[email protected]> * feat(proc_macro): apply suggestions - make parameter encoding DRY - remove strings from param_kind - return result from parse_param_kind * feat(proc_macro): formatting Co-authored-by: Maciej Hirsz <[email protected]>
-
- Oct 15, 2021
-
-
Niklas Adolfsson authored
-
Maciej Hirsz authored
* Re-introduce object param parsing * fmt and unnecessary collect
-
Maciej Hirsz authored
* register_blocking_method * Support `blocking` flag in `#[method]` * Macro support and tests * MacOS CI fails if there are too many blocking tasks * conn_id is never used in async callbacks * Dry-run blocking callbacks to maybe satisfy MacOS CI * Make tokio optional behind server feature flag * Document `blocking` flag use in `#[method]` * Comment why the test is disabled on mac * Fix warnings on macos tests
-
- 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
-
-
Maciej Hirsz authored
* Remove unused import * Add a simple test for angle braces in arguments * Argument parsing should permit commas inside angle brackets * Add a comment, move test to trybuild
-
Niklas Adolfsson authored
* fix(ParamsSer): serialize to empty array Serialize `ParamsSer::NoParams` to an empty array inorder to comply with the jsonrpc v2 spec. * fix tests * remove ParamsSer::NoParams * address grumbles: adjust rpc params macro
-
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 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 11, 2021
-
-
David authored
-
- Sep 09, 2021
-
-
Niklas Adolfsson authored
Similar to #435 that adds the same restrictions to subscriptions too. To avoid having faulty trait bounds on when the subcription actually returns Result.
-
- Sep 08, 2021
-
-
Niklas Adolfsson authored
* cleanup * Update ws-server/src/tests.rs * Update http-server/src/tests.rs
-
Niklas Adolfsson authored
* fix(proc macros): generate documentation Fixes #449 * revert proc macro example * add test that docs are generated * use import * address grumbles * make the code less ugly * simplify more * fix grumbles: check ident before parse * more grumbles: filter_map -> filter
-
- Sep 01, 2021
-
-
Niklas Adolfsson authored
* feat: alias attribute for proc macros * implement David's suggested no more unsub field * keep aliases outside namespace * revert example * fix build * Update proc-macros/src/attributes.rs Co-authored-by: David <[email protected]> * grumbles: alias -> aliases * grumbles v2: alias -> aliases Co-authored-by: David <[email protected]>
-
Niklas Adolfsson authored
* treat empty json as no params when optional * add test with nested array brackets * address grumbles: better tests * Update types/src/v2/params.rs Co-authored-by: David <[email protected]> * introduce RpcParams::sequence_ignore_empty * address grumbles: ignore empty json in RpcParams * Update proc-macros/src/render_server.rs * address grumbles: remove trim in next_inner() * address grumbles: trim_start after params.next() * address more grumbles * [proc macros]: add test for empty array * make proc macro kind of work * add hack to make it work in proc macros * add hack to make it work in proc macros * [] -> * revert cerebral palsy * Update proc-macros/tests/ui/correct/basic.rs * Update proc-macros/tests/ui/correct/basic.rs * address grumbles * improve is_option * add test for core::option::Option Co-authored-by: David <[email protected]>
-
- Aug 27, 2021
-
-
Niklas Adolfsson authored
* PoC support generic type params * more annoying example * add trait bounds for generic params in proc macros * add compile-time test for complicated trait * smarter trait bounds in proc macros * add non-working example for now * revert nits * Update examples/proc_macro.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/helpers.rs Co-authored-by: David <[email protected]> * add messy code but works * cleanup * add some simple compile check in tests * fix doc link * fix doc link last time * address grumbles * docs * Update proc-macros/src/helpers.rs * Update proc-macros/src/helpers.rs * Update proc-macros/src/helpers.rs * Update proc-macros/src/helpers.rs * Update proc-macros/src/visitor.rs * fix nit: | -> || * Update proc-macros/src/helpers.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/helpers.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/helpers.rs Co-authored-by: David <[email protected]> * add issues to introduced TODOs * generics support where clause on trait * Update proc-macros/src/helpers.rs Co-authored-by: David <[email protected]> * Update proc-macros/src/helpers.rs * address grumbles * add more docs 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]>
-
David authored
* Doc tweaks * More tweaks * Move proc macro code out of the "new" folder * fmt * Can't add doc-links to dev-dependencies
-
- 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
-
Maciej Hirsz authored
-
- Aug 13, 2021
-
-
Niklas Adolfsson authored
* fix: update example to new proc macros * remove unused code * remove client builder
-
- 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]>
-
David authored
* Only return the crate name when the crate is `jsonrpsee` as well * Sort out the type paths in the macros, this time for real (?) * fmt
-
David authored
* type paths in client macros * Tweak more paths * Helpers as well
-
- 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
-
-
Igor Aleksanov authored
* Start working on the new proc macro system * Add skeleton for rendering * Improve error reporting * Main part of 'render_client' * Implement RPC client generation * Client successfully rendered * Add doc-comment generation for the API client * Check that all the methods have receiver * Start working on the server impl * Add helper method to find server crate * Fix usage of client rpc path * Decent progress on the server macro implementation * Server macro compiled successfully * Remove unneeded re-export * Insert SubscriptionSink argument to the subscription server signatures * Add basic doc-comment for the macro * no_run -> ignore * Trait with subscription compiles * Extend the example * Add integration test for client/server impl * Add trybuild setup * Set correct span for attribute parsing related errors * Add basic set of trybuild tests * Add tests for client and server generated separately * Improve proc-macro documentation * Update proc-macros/src/lib.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Fix a couple of bugs in docs * Fix rendering subscription with params Co-authored-by: Niklas Adolfsson <[email protected]>
-
- Apr 29, 2021
-
-
Chevdor authored
* Fix clippy warning and enforce no warning in the CI * Fix clippy issue due to a pending TODO * Return an Err if attributes are equal * Remove clippy args * Fix typos and test names Co-authored-by: David Palm <[email protected]>
-
- 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 15, 2021
-
-
Niklas Adolfsson authored
* add wrapper crate * add jsonrpsee crate back * [jsonrpsee]: feature gate modules * [proc macros]: support crate renaming of `types` * Update proc-macros/src/lib.rs Co-authored-by: David <[email protected]> * re-export types * [proc macros]: remove unused features * Update proc-macros/Cargo.toml * fix bad merge Co-authored-by: David <[email protected]>
-
- Mar 05, 2021
-
-
Niklas Adolfsson authored
The generated enum variants is hack to bound the type params to the enum itself. Thus, the enum patterns are never used and will always generated warnings so this commit adds `unused` on all the variants.
-
- Mar 02, 2021
-
-
Niklas Adolfsson authored
* draft: client trait sketch... * use async_trait instead of `Box<Future>` * refactor client trait * [types]: shared client types. * integrate with `jsonrpsee_proc_macros::rpc_api` * Update proc-macros/src/lib.rs * integrate with proc macros * fix: hacky support for generic types in proc macro * fix: make the examples work. * trait: error associated type * Update types/src/traits.rs * client trait: make object safe. Make the trait usable as a trait object i.e, `Box<dyn Trait>` * client trait: remove `Self::Sized` * add tests for proc macros. * fix build * fmt * [client trait]: remove unused associated error typ * [proc macros]: separate enum variant each return_t * add tracking issue to `TODO` * doc(client trait): improve documentation. * separate trait for subscribing client * add documentation * proc macros: remove debug impl * fix compile warns * address grumbles: remove fn process_response * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * Update types/src/client.rs Co-authored-by: David <[email protected]> * remove old proc macro tests * address grumbles: shorter lines Co-authored-by: David <[email protected]>
-
- Jan 18, 2021
-
-
Niklas Adolfsson authored
* update http example * ungeneric crate * update dependencies * [client]: add WebSocket client again. * [deps]: remove needless dev dependencies * nits: forgot to commit new files * [ws client]: `send_text` instead of `send_binary` This is temporary fix to work with the `server` which assumes that `WebSocket` resonses are `text` * chore: add a bunch of more logging * [ws]: port tests but some are failing. * chore: fmt * [server API]: expose `fn local_addr` as public API. * [tests]: make them less ugly by using `127.0.0.1:0` * fix: a bunch of compiler warnings. * [api]: uniform naming, `bind -> new` in transport. * [websocket server]: reply when deserial fails When the server receives an request with invalid JSON `-32700, Parse error shall be returned` * chore: fmt * [tests]: fix remaining tests * [websocket server]: support `binary` and `text` * [ws server]: fix bug in subscription response. `.await` was missing in RegisteredSubscription::send() and no responses were actually sent which this commit fixes. * [client API]: export `WsSubscription` * [examples]: use `localhost` instead of `127.0.0.1` Hostname is required when using `wss` and `127.0.0.1` is not valid hostname. * [examples]: add subscription example. * chore: fmt * [ws server]: fix bug register new subscription. Fixes newly introduced bug that causes `register_subscription` to have side-effects even if the subscription fails. * fmt * more uniform logs * [ws server]: simple subscription test. * [ws server]: subscription tests improved. * [tests]: extract test helpers to a separate crate (#125) * [ws server]: don't close connection when `deserialization` fails (#131) * [ws server]: don't close conn. when `deser` fails * Update src/ws/transport.rs * grumbles: prefer matching of if else. * chore: CI warn `intra_doc_link_resolution_failure` (#139) Since we have not updated the documentation properly it's annoying that the entire job fails. * chore: rustfmt.toml (#138) * chore: add `rustfmt.toml` for formatting * style: `cargo fmt --all` with new config * [server raw params]: fix debug implementation (#137) * [server]: simply raw params impl Use debug implementation of `common::Params` instead of doing something similar that doesn't work properly. * [raw params]: derive `Debug` impl. * [ws server]: parse subscription ID for unsubscription instead of hardcoding `JsonValue::Null` (#136) * [ws server]: fix broken unsubscribe. Try to parse the subscription ID as the first element of an Array or the `subscription` field of an Object/Map. If both of those fails then regard it as a error. * fmt * fix grumbles: remove space indentation * fix(ws server): sub/unsubscribe to same method should generate an error (#140) * fix(ws server): sub/unsubscribe to same method err Subscribe and unsubscribe to the same method should generate an error, which this commit fixed. This bug was introduced by myself in https://github.com/paritytech/jsonrpsee/commit/fc87889de2615dbb3d0cf2d91a306f016d48df2d * Update src/ws/server.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]> * chore: add naive benches for request/response (#142) Co-authored-by: Niklas <[email protected]> * fix(ws server): remove faulty debug_assert (#145) The code assumed that `subscription id` is still in `active_subscriptions` when the connection was dropped. The list of subscriptions (kept in raw server) are not notified when a client dropped its subscription/unsubscribed thus it's possible that the actual subscriptions are closed before the entire client was dropped. * ci(benches): cargo check on benches. (#146) * fix(http client): implement `clone` uniform API. (#147) * chore(deps): update `futures v0.3.7` (#148) * chore(deps): update remaining crates (#149) * chore(deps): update `futures v0.3.7` * chore(deps): bump the rest of deps * Improve HTTP client background thread (#150) * refactor: resultify API + some crate reorg (#144) * [ws client]: resultify API and fix subscribe. * The commit changes the API to return `Err` when it's possible and to not ignore underlying errors. * Fix that `fn subscribe` doesn't accept the subscription and unsubscription to be same which causes errors in the server. * nits: Err::SubscriptionMetod -> Err::Subscription * refactor(client): common error type * refactor(http client): resultify * refactor(common): rename common -> types.. This commit renames the `common module` to `types` and tries to distinguish the types that is directly related to the `JSON-RPC v2 specification` from others. Somethings are a little big sloppy named as naming is hard. Also, as bonus a removed a bunch of needless stuff in http server related to subscription. * Update src/ws/tests.rs * style: cargo fmt * fix(grumble): matches -> assert(matches) * fix(grumbles): `jsonrpc_v2` -> `jsonrpc` * fix(nit): remove unused code. * fix(benches): make it compile again. * style: cargo fmt * fix nits (#151) * fix(ws client): send binary (1 byte less payload) * docs(ws server): fix bad comment. * chore: add `editorconfig` (#152) * chore: make `debug log` less verbose. (#153) * chore: make `debug log` less verbose. The debug logging was just too verbose and this commit simplies it as follows: ``` DEBUG recv: {"jsonrpc":"2.0","method":"<METHOD>","params":<PARAMS>,"id":<ID>} DEBUG send: {"jsonrpc":"2.0","result":"<RESULT>","id":<ID>} ``` * style: cargo fmt * fix: missed logs * [jsonrpc types]: implement Display for Request/Response (#160) * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * use serde_json for verbosity * [http client]: refactor with "syncronous-like" design (#156) * experimental * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * fix(nits) * feat(http client): limit max request body size * test(http transport): request limit test * test(http client): add tests. * fix typo * fix(benches): make it compile again. * fix(ws example): revert unintentional change. * test(http client): subscription response on call. * fix(cleanup) * fix(benches): make it compile again. * Update src/client/http/transport.rs * fix(http client): `&str` -> `AsRef<str>` * docs(client types): better docs for Mismatch type. * style: `Default::default` -> `HttpConfig::default` * fix(http client): read body size from header. Expermential to read number of bytes from `HTTP Content Length` to pre-allocate the number of bytes and bail early if the length is bigger than the `max_request_body size` Need to be benched with bigger requests. * test(raw http): enable tests to works again. * style: cargo fmt * benches: address grumbles * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * fix(http client): nits. * Update benches/benches.rs * fix bad merge. * chore(deps): update dependencies. (#164) * feat(http server): configurable request body limit (#162) * feat(http server): configurable request body limit * refactor(crate reorg): to have shared http helpers. * Merge client and server errors. * Move `http_server_utils` to `utils/http` * Minor cleanup * fix nits * fix(hyper helper): u64 -> u32 * Update src/utils/http/hyper_helpers.rs Co-authored-by: David <[email protected]> * Update src/utils/http/hyper_helpers.rs Co-authored-by: David <[email protected]> * fix: grumbles * Update src/utils/http/hyper_helpers.rs Co-authored-by: David <[email protected]> * Update src/http/server.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]> * ci: remove nightly (#167) Use stabilized `broken_intra_doc_links` instead of `intra_doc_link_resolution_failure` * fix(websocket client): drop subscriptions that can't keep up with the internal buffer size (#166) * fix(ws client): drop subscriptions when full. This commit changes the behavior in the `WebSocket Client` where each subscription channel is used in a non-blocking matter until it is determined as full or disconnected. When that occurs the channel is simply dropped and when the user `poll` the subscription it will return all sent subscriptions before it was and terminate (return None) once it's polled one last time. Similarly as `Streams` works in Rust. It also adds configuration for the `WebSocket Client` to configure capacity for the different internal channels to avoid filling the buffers when it's not expected. * tests(ws client): simple subscription test. * fix: nits * Update src/client/ws/client.rs * refactor(tests): introduce integration_tests Make the repo structure more understable w.r.t testing. * chore(license): add missing license headers * Update src/client/ws/client.rs * Update src/client/ws/client.rs * style: remove unintended spaces. * tests: add concurrent deadlock test Ensure that if more than the requested channel buffer capacity is exceeded it should not deadlock. Such as spawning alot of concurrent requests, notifications or new subscriptions. * Update src/client/ws/client.rs * fix: review grumbles * fix nits: `remove needless closure` * fix: cargo fmt * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> * fix more nits Co-authored-by: David <[email protected]> * fix(ws client): embed request id in `SubscriptionClosed` (#170) * fix(ws client): embed request id SubscriptClosed Fixes https://github.com/paritytech/jsonrpsee/issues/169 * Update src/client/ws/client.rs * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> Co-authored-by: David <[email protected]> * chore(deps): bump dependencies (#172) * [ws client]: add tests (#134) * [test utils]: add `internal_err` and consts [errors]: unify client/server errors [test utils]: fake WebSocket jsonrpc server [ws client]: export errors [ws client]: add some basic tests * fmt * remove log target * fix nits * [ws client]: add subscription test * revert unintendend changes. * fmt * [ws client]: fix panic in tests * cleanup * tests(ws client): test for invalid request ID. * fix nits * [ws client]: kill raw client (#171) * getting started * WIP WIP * cleanup * cleanup v2 * cleanup v3 * perf: use BufReader BufWriter * fix(request manager): resultify insert API The rationale behind this change is that the `insert_methods` takes ownership of the `send_back_oneshot` and if the operation fails it should be propagated the frontend. So returning the `Err(send_back_oneshot)` if it fails makes it possible. * fix nits * examples(ws): revert changes * Update tests/integration_tests.rs * nits: fix unwraps * Update src/client/ws/manager.rs Co-authored-by: David <[email protected]> * Update src/client/ws/transport.rs Co-authored-by: David <[email protected]> * Update src/client/ws/client.rs Co-authored-by: David <[email protected]> * fix build * refactor: simplify `Error::InvalidRequestId` It was hard to use when the expected id is not known. * fix(ws client): error handling. * fix(grumble error type): better error message. * fix(grumble): docs `JSONRPC WebSocket transport` * fix(ws manager): fix grumbles. * Add better documentation * Rename methods. * Add `proof` to unreachable! * fix(ws manager): fix nit in docs. * fix(grumbles): ws client * fix more nits * fix compile warning: export websocket transports. * Update src/client/ws/manager.rs Co-authored-by: David <[email protected]> * deps: tokio 1.0 and hyper 0.14 (#176) * deps: tokio 1.0 and hyper 0.14 * Update Cargo.toml * refactor: crate re-organization with separate crates (#177) * [ci]: feature `http` and `ws` removed. * refactor: re-org crate with smaller crates. * fmt * [ci]: remove default features Currently there are no features in the crates, so that check is not needed. * [http client]: remove unused dependency tokio * docs(http client): fix nits tokio 0.2 -> tokio 1.0 (#178) * docs(http client): tokio 0.2 -> tokio 1.0 * fix: better link * [ci]: github actions (#179) * docs(http client): tokio 0.2 -> tokio 1.0 * [ci]: remove travis * [ci]: add github actions. * [ci]: fix identation nits * [ci]: use cache for actions * [ci]: filter to clippy * [ci]: remove hacks * separate action for ci and benchmarks * [ci]: tweak to run on master branch. * examples/subscription -> examples/ws_subscription * force CI Co-authored-by: David <[email protected]> Co-authored-by: Maciej Hirsz <[email protected]> Co-authored-by: Atkins <[email protected]>
-