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

Support priority pass down to transport #89

Merged
merged 7 commits into from
Oct 30, 2023
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
13 changes: 12 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,19 @@ jobs:
if: matrix.os == 'macos-latest'

- name: Install Packages (Ubuntu)
run: sudo apt-get install -y clang-tidy
run: |
sudo apt-get install -y clang-tidy
if: matrix.os == 'ubuntu-latest'

# Work around https://github.com/actions/runner-images/issues/8659
- name: "[Ubuntu] Remove GCC 13 from runner image"
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
echo "TEMPORARY WORKAROUND FOR GITHUB RUNNER BUG #8659\n\nRemoving GCC 13 as it breaks Clang14"
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.35-0ubuntu3.4 libc6-dev=2.35-0ubuntu3.4 libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
2 changes: 1 addition & 1 deletion dependencies/qname
2 changes: 1 addition & 1 deletion dependencies/transport
5 changes: 4 additions & 1 deletion include/quicr/quicr_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ class Client
* @param payload : Opaque payload to be forwarded to Origin
* @param use_reliable_transport : Indicates to use reliable for matching
* published objects
* @param priority : Identifies the relative priority for the stream if reliable
*
*/
bool publishIntent(std::shared_ptr<PublisherDelegate> pub_delegate,
const quicr::Namespace& quicr_namespace,
const std::string& origin_url,
const std::string& auth_token,
bytes&& payload,
bool use_reliable_transport = false);
bool use_reliable_transport = false,
uint8_t priority = 1);

/**
* @brief Stop publishing on the given QUICR namespace
Expand Down
4 changes: 3 additions & 1 deletion include/quicr/quicr_client_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ class ClientSession
* Origin
* @param use_reliable_transport : Indicates to use reliable for matching
* published objects
* @param priority : Identifies the relative priority for the stream if reliable
*/
virtual bool publishIntent(std::shared_ptr<PublisherDelegate> pub_delegate,
const quicr::Namespace& quicr_namespace,
const std::string& origin_url,
const std::string& auth_token,
bytes&& payload,
bool use_reliable_transport) = 0;
bool use_reliable_transport,
uint8_t priority) = 0;

/**
* @brief Stop publishing on the given QUICR namespace
Expand Down
6 changes: 4 additions & 2 deletions src/quicr_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ Client::publishIntent(std::shared_ptr<PublisherDelegate> pub_delegate,
const std::string& origin_url,
const std::string& auth_token,
bytes&& payload,
bool use_reliable_transport)
bool use_reliable_transport,
uint8_t priority)
{
return client_session->publishIntent(std::move(pub_delegate),
quicr_namespace,
origin_url,
auth_token,
std::move(payload),
use_reliable_transport);
use_reliable_transport,
priority);
}

void
Expand Down
6 changes: 4 additions & 2 deletions src/quicr_client_raw_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ ClientRawSession::publishIntent(std::shared_ptr<PublisherDelegate> pub_delegate,
const std::string& /* origin_url */,
const std::string& /* auth_token */,
bytes&& payload,
bool use_reliable_transport)
bool use_reliable_transport,
uint8_t priority)
{
if (pub_delegates.contains(quicr_namespace)) {
return true;
Expand All @@ -261,7 +262,8 @@ ClientRawSession::publishIntent(std::shared_ptr<PublisherDelegate> pub_delegate,
const auto& context_id = transport_context_id.value();
auto stream_id = transport_dgram_stream_id.value();
if (use_reliable_transport) {
stream_id = transport->createStream(context_id, true);
stream_id = transport->createStream(context_id, true, priority);
logger->debug << "Set stream: " << stream_id << " to priority: " << static_cast<int>(priority) << std::flush;
}

publish_state[quicr_namespace] = {
Expand Down
6 changes: 4 additions & 2 deletions src/quicr_client_raw_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ class ClientRawSession
* @param payload : Opaque payload to be forwarded to the
* Origin
* @param use_reliable_transport : Indicates to use reliable for matching
* published objects
* published objects
* @param priority : Identifies the relative priority for the stream if reliable
*/
bool publishIntent(std::shared_ptr<PublisherDelegate> pub_delegate,
const quicr::Namespace& quicr_namespace,
const std::string& origin_url,
const std::string& auth_token,
bytes&& payload,
bool use_reliable_transport) override;
bool use_reliable_transport,
uint8_t priority) override;

/**
* @brief Stop publishing on the given QUICR namespace
Expand Down