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 1 commit
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
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
Loading