adblock-rust | Brave 's Rust-based adblock engine
kandi X-RAY | adblock-rust Summary
kandi X-RAY | adblock-rust Summary
Brave's Rust-based adblock engine
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of adblock-rust
adblock-rust Key Features
adblock-rust Examples and Code Snippets
Community Discussions
Trending Discussions on adblock-rust
QUESTION
Not to my preference but I'm forced to write some Rust today so I'm trying to create a Rocket instance with only one endpoint but, on that endpoint I need to access a variable that is being created during main. The variable takes a long time to be instantiated so that's why I do it there.
My problem is that I can;t find a way to pass it safely. Whatever I do, the compiler complaints about thread safety even though the library appears to be thread safe: https://github.com/brave/adblock-rust/pull/130 (commited code is found on my local instance)
This is the error tat I get:
...ANSWER
Answered 2020-Sep-06 at 10:55Rc
is not thread safe, even behind a mutex. It looks like Rc
is used in eng.blocker.pool.pool
which is a lifeguard::Pool
. So no, the Engine
is not thread safe (at least by default).
Fortunately, it appears that the adblock crate has a feature called "object-pooling", which enables that specific functionality. Removing that feature will (hopefully) make it thread safe.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install adblock-rust
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page