Code Monkey home page Code Monkey logo

leaning-tower's People

Contributors

torsteingrindvik avatar

Stargazers

 avatar

Watchers

 avatar

leaning-tower's Issues

Investigate use of `Box`

Right now, futures are boxed wherever necessary.
Following the scheme of tower, we might be able to move this to use custom structs which impl Future instead.

The perf gain (if any) is not really crucial for my own use so this is more of a learning experience.

Better error handling

anyhow is used right now.
Remove it as a dependency and make a "proper" error enum.

No matching resources should not be an error

If we have a server and we .await it, it will serve the connection as long as communication is successful.
If we return an error on no matching resources (which is a perfectly normal expectation in normal use), the server will quit.

Therefore, we need to change from T into Option<T> and use None where we previously used an Err.

Add ability to use several allocators

We give many services to an allocator in order for it to be able to give us exclusive access of the first available matching service upon requests.

However, we want another layer: We want to allow services to be distributed across endpoints as well.
I.e. we want to be able to have services behind allocators at various IP addresses, but a client shall still be able to ask to see it as a single allocator service.

So:

  • Set up several allocators
  • Wrap them in some service
    • This wrapper has the same request type as the allocators
    • The wrapper duplicates the request to all allocators
    • The end user will receive the first successful response from any allocator
      • Remaining allocator futures are cancelled

Note that while a single allocator responds with a port number (where the new TCP connection resides), this is not enough now.
The port must be extended to have the IP address as well now.

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.