Giter Site home page Giter Site logo

gruglb's Issues

Investigate `tokio` usage and `scoped` threads

The tokio ecosystem makes a lot of things simpler for async, even though this was avoided initially for this project (by using entirely std::thread and avoiding async calls. Now that it is in a good-state, I can expand into changing things around for tokio usage.


Another area to investigate is scoped threads since all threads do not have their JoinHandle's managed, they is no call to .join() on their usage.

graceful shutdown

At the moment the application simply quits and will instantly sever connections.

The shutdown process should be handled gracefully.


It looks like this should be easily achievable with a CancellationToken from tokio.

This might require a small amount of refactoring, but I envision a CancellationToken being passed as part of the Proxy trait, perhaps even held within self for the Tcp|HttpProxy.proxy(...) behaviour, rather than calling it from TcpProxy::proxy(...) instead?

Investigate lock-free/alternative to `Arc<Mutex<HashMap<T>>>`

I believe there are some "better" alternatives to using a Mutex around the std::collections::HashMap, this will need some testing/investigation though.

A quick cursory search leads to:

Either of these could be useful in simplifying the locking of the HashMap for healthy targets.


There has been an external recommendation on dashmap, but also consider using RwLock if I can deem that the number of updates comparative to reads is fairly small.

Expand error handling with `anyhow` and `thiserror`

At the moment, anyhow is being used as an easy way to use the ? operator from within functions, with relatively minimal error handling and customisation.

Expanding on this to return customised errors which are relevant to the flow would be hugely useful in debugging and also providing a .with_context(...) to what happened.

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.