-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send events through channel #360
Labels
Comments
Mingun
added
help wanted
question
documentation
Issues about improvements or bugs in documentation
labels
May 25, 2022
This code is worked for me: /// Regression test for https://github.com/tafia/quick-xml/issues/360
#[test]
fn issue360() {
let mut r = Reader::from_str("<tag1 attr1='line 1\nline 2'></tag1>");
let (tx, rx) = std::sync::mpsc::channel::<Event>();
loop {
match r.read_event() {
Ok(Event::Eof) => break,
ev => tx.send(ev.unwrap()).unwrap(),
}
}
std::thread::spawn(move || {
// Ok(Start(BytesStart { buf: Borrowed("tag1 attr1='line 10xAline 2'"), name_len: 4 }))
println!("{:?}", rx.recv());
}).join().unwrap();
} @derolf, It that is not what you want, please add a comment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Look at this broken piece of code:
I'd like to decode the XML in one thread and send the events via a channel. Do you have a minimum example on how to do this?
The text was updated successfully, but these errors were encountered: