Skip to content

Send events through channel #360

@derolf

Description

@derolf

Look at this broken piece of code:

  let mut xml = Reader::from_reader(...);
  let (tx, rx) = mpsc::channel::<Event>();
  let mut buf = Vec::new();
  
  loop {
      let ev = xml.read_event(&mut buf);
      tx.send(ev.unwrap());
  }
}

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions