Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename net29 -> net #15

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# cmake-format: on

cmake_minimum_required(VERSION 3.23)
project(beman_net29 VERSION 0.0.0 LANGUAGES CXX)
set(TARGET_NAME net29)
project(beman_net VERSION 0.0.0 LANGUAGES CXX)
set(TARGET_NAME net)
set(TARGET_PREFIX beman.${TARGET_NAME})
set(TARGET_LIBRARY beman_${TARGET_NAME})
set(TARGET_ALIAS beman::${TARGET_NAME})
Expand All @@ -24,11 +24,11 @@ FetchContent_MakeAvailable(execution26)

include(CTest)
if(BUILD_TESTING)
add_subdirectory(src/beman/${TARGET_NAME}/tests)
add_subdirectory(tests/beman/${TARGET_NAME})
enable_testing()
endif()

add_subdirectory(src/beman/net29)
add_subdirectory(src/beman/net)
add_subdirectory(examples)

include(GNUInstallDirs)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ce:
@mkdir -p $(BUILD)
bin/mk-compiler-explorer.py $(BUILD)

SOURCE_CMAKELISTS = src/beman/net29/CMakeLists.txt
SOURCE_CMAKELISTS = src/beman/net/CMakeLists.txt
update:
bin/update-cmake-headers.py $(SOURCE_CMAKELISTS)

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# beman.net29: Senders For Network Operations
# beman.net: Senders For Network Operations

<img src="https://github.com/bemanproject/beman/blob/main/images/logos/beman_logo-beman_library_under_development.png" style="width:5%; height:auto;">

`beman.net29` provides senders for asynchronous network operations.
`beman.net` provides senders for asynchronous network operations.
It is based on [P2762R2](https://wg21.link/P2762R2). Both the proposal
and the implementation are in an early state although basic
functionality is provided.

`beman.net29` builds on top of [`beman.execution26`](https://github.com/bemanproject/execution26). The
`beman.net` builds on top of [`beman.execution26`](https://github.com/bemanproject/execution26). The
implementation should allow multiple ways how to support asynchronous
operations although currently the only implemented approach is based
on `poll(2)`. Implementations using `kqueue(2)`, `epoll(2)`,
Expand All @@ -22,7 +22,7 @@ possible use various libraries for asynchronous operations like
## Help Welcome!

There are plenty of things which need to be done. Some of these
are listed in the [issues section](https://github.com/bemanproject/net29/issues).
are listed in the [issues section](https://github.com/bemanproject/net/issues).
Other contributions are, of course, also welcome. Aside from contributing
code the project welcomes reports on usage experience, code reviews, defect
reports, features requests, etc. There are plenty contribution opportunities.
Expand All @@ -45,7 +45,7 @@ use something akin to the current interface.
## Building

Currently, the interfaces are entirely implemented in headers, i.e.,
there isn't a library needed. However, using the library `libbeman_net29`
there isn't a library needed. However, using the library `libbeman_net`
should make the relevant paths to headers available. The following
instructions build the library and the examples (required libraries are
obtained and build using these instructions):
Expand All @@ -57,4 +57,4 @@ The code is working on MacOS building with the system's
[`clang`](https://clang.llvm.org/) and recent [`gcc`](http://gcc.gnu.org/).
It should hopefully also work on Linux but it isn't tested, yet.
Windows isn't supported, yet, primarily because the relevant class
for the networking operations are different.
for the networking operations are different.
4 changes: 2 additions & 2 deletions examples/client.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// examples/client.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <functional>
#include <iostream>
#include <memory>
#include "demo_task.hpp"
#include "demo_scope.hpp"

namespace ex = ::beman::execution26;
namespace net = ::beman::net29;
namespace net = ::beman::net;

// ----------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions examples/cppcon-2024.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// examples/http-server.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <beman/execution26/execution.hpp>
#include "demo_algorithm.hpp"
#include "demo_error.hpp"
Expand All @@ -15,7 +15,7 @@
#include <unordered_map>

namespace ex = beman::execution26;
namespace net = beman::net29;
namespace net = beman::net;
using namespace std::chrono_literals;

// ----------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions examples/demo_algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# pragma clang diagnostic ignored "-Wmissing-braces"
#endif

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <atomic>
#include <optional>
#include <tuple>
Expand All @@ -32,7 +32,7 @@

namespace demo
{
namespace ex = ::beman::net29::detail::ex;
namespace ex = ::beman::net::detail::ex;
}

namespace demo::detail
Expand Down Expand Up @@ -225,9 +225,9 @@ inline auto demo::into_error_t::operator()(Fun&& fun) const
#if 202202L <= __cpp_lib_expected
inline auto demo::into_expected_t::operator()() const
{
return beman::net29::detail::ex::detail::sender_adaptor{*this};
return beman::net::detail::ex::detail::sender_adaptor{*this};
}
template <beman::net29::detail::ex::sender Sender>
template <beman::net::detail::ex::sender Sender>
inline auto demo::into_expected_t::operator()(Sender&& s) const
{
using value_type = ex::value_types_of_t<
Expand All @@ -238,12 +238,12 @@ inline auto demo::into_expected_t::operator()(Sender&& s) const
>;
using error_type = ex::error_types_of_t<Sender>;
return ::std::forward<Sender>(s)
| beman::net29::detail::ex::then([]<typename... A>(A&&... a)noexcept{
| beman::net::detail::ex::then([]<typename... A>(A&&... a)noexcept{
return std::expected<value_type, error_type>(
::std::in_place_t{}, ::std::forward<A>(a)...
);
})
| beman::net29::detail::ex::upon_error([]<typename E>(E&& e)noexcept{
| beman::net::detail::ex::upon_error([]<typename E>(E&& e)noexcept{
return std::expected<value_type, error_type>(
::std::unexpect_t{}, ::std::forward<E>(e)
);
Expand Down Expand Up @@ -397,7 +397,7 @@ struct demo::when_any_t::state<::std::index_sequence<I...>, Receiver, Value, Err
state(R&& receiver, P&& s)
: state_value<Receiver, value_type, error_type>(sizeof...(Sender), ::std::forward<R>(receiver))
, states{demo::ex::connect(
::beman::net29::detail::ex::detail::forward_like<P>(s.template get<I>()),
::beman::net::detail::ex::detail::forward_like<P>(s.template get<I>()),
receiver_type<I>{this}
)...}
{
Expand Down
4 changes: 2 additions & 2 deletions examples/demo_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef INCLUDED_EXAMPLES_DEMO_SCOPE
#define INCLUDED_EXAMPLES_DEMO_SCOPE

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <atomic>
#include <iostream>
#include <utility>
Expand All @@ -13,7 +13,7 @@

namespace demo
{
namespace ex = ::beman::net29::detail::ex;
namespace ex = ::beman::net::detail::ex;

class scope
{
Expand Down
24 changes: 12 additions & 12 deletions examples/demo_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef INCLUDED_EXAMPLES_DEMO_TASK
#define INCLUDED_EXAMPLES_DEMO_TASK

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <exception>
#include <coroutine>
#include <memory>
Expand All @@ -20,7 +20,7 @@

namespace demo
{
namespace ex = ::beman::net29::detail::ex;
namespace ex = ::beman::net::detail::ex;

template <typename T>
struct task_state_base
Expand All @@ -33,7 +33,7 @@ namespace demo
template <typename Receiver>
auto complete_set_value(Receiver& receiver)
{
::beman::net29::detail::ex::set_value(
::beman::net::detail::ex::set_value(
::std::move(receiver), ::std::move(*this->task_result)
);
}
Expand All @@ -48,7 +48,7 @@ namespace demo
template <typename Receiver>
auto complete_set_value(Receiver& receiver)
{
::beman::net29::detail::ex::set_value(::std::move(receiver));
::beman::net::detail::ex::set_value(::std::move(receiver));
}
};

Expand Down Expand Up @@ -85,9 +85,9 @@ namespace demo
};

template <typename T>
struct task_completion { using type = ::beman::net29::detail::ex::set_value_t(T); };
struct task_completion { using type = ::beman::net::detail::ex::set_value_t(T); };
template <>
struct task_completion<void> { using type = ::beman::net29::detail::ex::set_value_t(); };
struct task_completion<void> { using type = ::beman::net::detail::ex::set_value_t(); };

template <typename Result = void>
struct task
Expand Down Expand Up @@ -245,23 +245,23 @@ namespace demo
}
auto complete_error(::std::exception_ptr error) -> void override
{
::beman::net29::detail::ex::set_error(
::beman::net::detail::ex::set_error(
::std::move(this->receiver),
::std::move(error)
);
}
auto complete_stopped() -> void override
{
::beman::net29::detail::ex::set_stopped(::std::move(this->receiver));
::beman::net::detail::ex::set_stopped(::std::move(this->receiver));
}
};

unique_handle handle;

using sender_concept = ::beman::net29::detail::ex::sender_t;
using completion_signatures = ::beman::net29::detail::ex::completion_signatures<
::beman::net29::detail::ex::set_error_t(::std::exception_ptr),
::beman::net29::detail::ex::set_stopped_t(),
using sender_concept = ::beman::net::detail::ex::sender_t;
using completion_signatures = ::beman::net::detail::ex::completion_signatures<
::beman::net::detail::ex::set_error_t(::std::exception_ptr),
::beman::net::detail::ex::set_stopped_t(),
typename task_completion<::std::decay_t<Result>>::type
>;

Expand Down
4 changes: 2 additions & 2 deletions examples/empty.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// examples/http-server.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <beman/execution26/execution.hpp>
#include "demo_algorithm.hpp"
#include "demo_error.hpp"
Expand All @@ -15,7 +15,7 @@
#include <unordered_map>

namespace ex = beman::execution26;
namespace net = beman::net29;
namespace net = beman::net;
using namespace std::chrono_literals;

// ----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions examples/http-server.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// examples/http-server.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <beman/execution26/execution.hpp>
#include "demo_algorithm.hpp"
#include "demo_scope.hpp"
Expand All @@ -14,7 +14,7 @@
#include <unordered_map>

namespace ex = beman::execution26;
namespace net = beman::net29;
namespace net = beman::net;
using namespace std::chrono_literals;

// ----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions examples/milano.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// examples/http-server.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include <beman/execution26/execution.hpp>
#include "demo_algorithm.hpp"
#include "demo_error.hpp"
Expand All @@ -15,7 +15,7 @@
#include <unordered_map>

namespace ex = beman::execution26;
namespace net = beman::net29;
namespace net = beman::net;
using namespace std::chrono_literals;

// ----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions examples/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include <functional>
#include <string_view>
#include <beman/execution26/execution.hpp>
#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include "demo_algorithm.hpp"
#include "demo_scope.hpp"
#include "demo_task.hpp"

namespace ex = ::beman::execution26;
namespace net = ::beman::net29;
namespace net = ::beman::net;
using namespace std::chrono_literals;

auto use(auto&&) -> void {}
Expand Down
4 changes: 2 additions & 2 deletions examples/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#include <functional>
#include <string_view>
#include <beman/execution26/execution.hpp>
#include <beman/net29/net.hpp>
#include <beman/net/net.hpp>
#include "demo_scope.hpp"
#include "demo_task.hpp"

namespace ex = ::beman::execution26;
namespace net = ::beman::net29;
namespace net = ::beman::net;

namespace
{
Expand Down
Loading
Loading