Giter Club home page Giter Club logo

Comments (7)

BurntSushi avatar BurntSushi commented on August 22, 2024

The Read trait supports that.

I will not be adding async support without a very compelling and detailed justification for it. If you can provide that, we can reopen this issue.

from aho-corasick.

jakajancar avatar jakajancar commented on August 22, 2024

If I wanted to do something like:

let in: &[u8] = ...;
let out: &[u8] = replacer.feed(in);

How can this be done with the current interface?
Note that replacer was pre-existing, so might be in a non-initial state (not trying to feed all of the input at once).

from aho-corasick.

BurntSushi avatar BurntSushi commented on August 22, 2024

You haven't described your problem in enough detail for me to be able to answer you.

async seems like a red herring.

It sounds like you want a push API, but this crate only exposes a pull API. If you want a push API you'll probably need to build it yourself using regex-automata.

from aho-corasick.

jakajancar avatar jakajancar commented on August 22, 2024

I’m fine with push or pull, just don’t want to have a thread/stack allocated for each long-running replacer.

Use-case is streaming log filtering.

from aho-corasick.

BurntSushi avatar BurntSushi commented on August 22, 2024

Like I said, I don't see this happening without a very detailed investigation. This crate is primarily about text search, which is a CPU bound operation. There's only a tiny little sliver of API that has anything to do with I/O, and that's a convenience function for searching std::io::Read because it's a low hanging fruit.

from aho-corasick.

BurntSushi avatar BurntSushi commented on August 22, 2024

I would rather work to expose APIs that permit callers to implement any necessary I/O glue instead of providing it in this crate.

from aho-corasick.

jakajancar avatar jakajancar commented on August 22, 2024

I’m not asking for Tokio/futures Streams/… support, to be clear. Fine with any API that allows me to write the glue.

Maybe this API aready exists, I just don’t have the imagination how to make it work short of allocating a dedicated thread. Pull is fine, but then needs O_NONBLOCK :)

Rephrased differently, I’d like to get the internal state somewhere else than on the stack if possible, so I can resume later.

Thanks for the pointer to regex-automata!

from aho-corasick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.