chore(eth-websocket): remove some unnecessary wrappers#2291
Merged
onur-ozkan merged 5 commits intodevfrom Dec 26, 2024
Merged
Conversation
The inners are already `Arc<`ed
22ff5c1 to
a394c6a
Compare
borngraced
suggested changes
Dec 23, 2024
Comment on lines
+89
to
+92
| controller_channel: ControllerChannel { | ||
| tx: Arc::new(AsyncMutex::new(req_tx)), | ||
| tx: req_tx, | ||
| rx: Arc::new(AsyncMutex::new(req_rx)), | ||
| } | ||
| .into(), | ||
| }, |
Collaborator
Author
There was a problem hiding this comment.
that arc was indeed the unnecessary one, thanks :)
8ae149b
onur-ozkan
reviewed
Dec 25, 2024
Comment on lines
+49
to
+53
| controller_channel: Arc<ControllerChannel>, | ||
| controller_channel: ControllerChannel, | ||
| connection_guard: Arc<AsyncMutex<()>>, | ||
| } | ||
|
|
||
| #[derive(Debug)] | ||
| #[derive(Clone, Debug)] |
Collaborator
Author
There was a problem hiding this comment.
both tx & rx inside were Arced which made me think we extract/clone them out of ContollerChannel so wrapping with a bigger arc is just a complex optimization.
this doesn't seem the case though (tx already clonable, rx was never cloned out in the first place).
8ae149b
and arc the entire controller channel instead
onur-ozkan
approved these changes
Dec 26, 2024
borngraced
approved these changes
Dec 26, 2024
dimxy
pushed a commit
to dimxy/komodo-defi-framework
that referenced
this pull request
Jan 17, 2025
* dev: (35 commits) fix(crypto): allow non bip39 mnemonics storage (GLEECBTC#2312) fix(legacy_swap): check for existing maker/taker payment before timeout (GLEECBTC#2283) feat(tendermint): validators RPC (GLEECBTC#2310) chore(CI): validate Cargo lock file (GLEECBTC#2309) test(P2P): add test for peer time sync validation (GLEECBTC#2304) fix mm2_p2p dev build (GLEECBTC#2311) update Cargo.lock (GLEECBTC#2308) chore(CI): unlock wasm-pack version (GLEECBTC#2307) add `wasm` feature on WASM for timed-map (GLEECBTC#2306) replace broken rpc link (GLEECBTC#2305) chore(eth-websocket): remove some unnecessary wrappers (GLEECBTC#2291) improvement(CI): switch to proper rust caching (GLEECBTC#2303) fix(wasm): add test-ext-api feature to mm2_main and mm2_bin_lib tomls (GLEECBTC#2295) chore(ci): Update docker build for wasm (GLEECBTC#2294) chore(p2p): follow-up nits (GLEECBTC#2302) feat(p2p): ensure time synchronization in the network (GLEECBTC#2255) bump libp2p (GLEECBTC#2296) chore(adex-cli): use "Komodo DeFi Framework" name in adex_cli (GLEECBTC#2290) chore(ctx): replace gstuff constructible with oncelock (GLEECBTC#2267) don't rely on core (GLEECBTC#2289) ...
shamardy
pushed a commit
that referenced
this pull request
Jan 28, 2025
* remove unnecessary Arc< The inners are already `Arc<`ed * eth websocket: avoid locking control message sender and clone it instead * review(sami): move tx declaration close to where it's being used * review(sami): free rx end out of the Arc and arc the entire controller channel instead
shamardy
pushed a commit
that referenced
this pull request
Jan 30, 2025
* remove unnecessary Arc< The inners are already `Arc<`ed * eth websocket: avoid locking control message sender and clone it instead * review(sami): move tx declaration close to where it's being used * review(sami): free rx end out of the Arc and arc the entire controller channel instead
shamardy
pushed a commit
that referenced
this pull request
Jan 30, 2025
* remove unnecessary Arc< The inners are already `Arc<`ed * eth websocket: avoid locking control message sender and clone it instead * review(sami): move tx declaration close to where it's being used * review(sami): free rx end out of the Arc and arc the entire controller channel instead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes some
Arcs andMutexs that aren't needed (because of another wrappingArcor the object being already thread-safe).