maikel / senders-io Goto Github PK
View Code? Open in Web Editor NEWAn adaption of Senders/Receivers for async networking and I/O
License: Apache License 2.0
An adaption of Senders/Receivers for async networking and I/O
License: Apache License 2.0
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
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?
See https://github.com/maikel/stdexec/blob/sequence-senders/include/exec/sequence/merge_each.hpp for an example impl
async::accept
returns a sequence of socket_handle
s.
The lifetime of the underlying socket is bounded by the operations lifetime of the sequence elements
Come up with an interface to use io_urings registered buffers
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.
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
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.
The implementation for endpoints and adresses is incomplete. The resolver needs refactoring
Implement a timeout algorithm that uses when_any
as default implementation
The current socket implementation of io_uring
assumes an ip::endpoint
. We should implement local::endpoint
and a local::stream_protocol
similar to asio https://www.boost.org/doc/libs/1_82_0/doc/html/boost_asio/reference/local__stream_protocol.html
reduce is last(scan)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.