Coder Social home page Coder Social logo

senders-io's People

Contributors

maikel avatar mfbalin avatar runner-2019 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mfbalin

senders-io's Issues

Implement an async allocator

An async_allocator<T> provides functions of an allocate but returning senders instead of the values.

The defaulted async allocator could be one that blockingly calls std::allocator<T>. But we could implement an async memory pool where an allocate sender completes when a suitable memory chunk gets available.

This can be used in an async::accept algorithm

stdexec version to use?

I tried using stdexec from nvhpc-23.09.rc4 and HEAD, but both produce the same build error:

vscode โžœ /workspaces/cxx-init/senders-io (main) $ cmake --build build/ --parallel
[  2%] Building CXX object CMakeFiles/sio.dir/source/sio/const_buffer_span.cpp.o
[  8%] Building CXX object CMakeFiles/sio.dir/source/sio/io_uring/file_handle.cpp.o
[  8%] Building CXX object CMakeFiles/sio.dir/source/sio/mutable_buffer_span.cpp.o
[ 11%] Building CXX object CMakeFiles/sio.dir/source/sio/memory_pool.cpp.o
In file included from /workspaces/cxx-init/senders-io/source/sio/memory_pool.cpp:1:
/workspaces/cxx-init/senders-io/source/sio/./memory_pool.hpp:197:17: error: no matching function for call to object of type 'const __connect::connect_t'
  197 |       auto op = stdexec::connect(self, rcvr{})

Is there a specific commit that needs to be used?

Implement an async accept algorithm

async::accept returns a sequence of socket_handles.

The lifetime of the underlying socket is bounded by the operations lifetime of the sequence elements

Rework async_allocator

I've discussed the async_allocator with kirk and its probably better to not give out senders to raw memory allocation but instead to async_new and async_delete which does both, allocation/construction and deallocation/destroy.

test_resolve.cpp fails

I have compiled inside a docker container with G++11. After running the tests, all but a single fail is observed. The test output below:

root@a100cse:/localscratch/senders-io/build/tests# ./test_sio 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test_sio is a Catch v2.13.6 host application.
Run with -? for options

-------------------------------------------------------------------------------
async::resolve - Resolve ipv4 localhost
-------------------------------------------------------------------------------
/localscratch/senders-io/tests/net/test_resolve.cpp:22
...............................................................................

/localscratch/senders-io/tests/net/test_resolve.cpp:22: FAILED:
due to unexpected exception with message:
  Servname not supported for ai_socktype

===============================================================================
test cases:  87 |  86 passed | 1 failed
assertions: 306 | 305 passed | 1 failed

Building senders-io

Great work! I am trying to experiment with the file_handle API in this library. I added stdexec dependency using CPM but couldn't get the library to compile. What version of the compiler and stdexec do I need to build this library?

Also, what is the use of passing multiple buffers to the read API? From what I can see, the read happens from a single offset, and the buffers are filled one after another. It would be nice to have a batched read that takes a span of buffers and a span of offsets in one-to-one correspondence.

Timeout algorithm

Implement a timeout algorithm that uses when_any as default implementation

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.