Skip to content

Commit

Permalink
fix: Remove vendored boost file to compile with boost 1.87.
Browse files Browse the repository at this point in the history
fix: Replace expires_from_now with expires_after.
  • Loading branch information
kinyoklion committed Dec 19, 2024
1 parent 3772096 commit 42cc871
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 496 deletions.
6 changes: 3 additions & 3 deletions contract-tests/sse-contract-tests/src/event_outbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ void EventOutbox::do_shutdown(beast::error_code ec) {
void EventOutbox::post_event(launchdarkly::sse::Event event) {
auto http_request = build_request(callback_counter_++, std::move(event));
outbox_.push(http_request);
flush_timer_.expires_from_now(boost::posix_time::milliseconds(0));
flush_timer_.expires_after(boost::posix_time::milliseconds(0));
}

void EventOutbox::post_error(launchdarkly::sse::Error error) {
auto http_request = build_request(callback_counter_++, error);
outbox_.push(http_request);
flush_timer_.expires_from_now(boost::posix_time::milliseconds(0));
flush_timer_.expires_after(boost::posix_time::milliseconds(0));
}

void EventOutbox::run() {
Expand Down Expand Up @@ -133,7 +133,7 @@ void EventOutbox::on_flush_timer(boost::system::error_code ec) {
}

// If the outbox is empty, wait a bit before trying again.
flush_timer_.expires_from_now(kFlushInterval);
flush_timer_.expires_after(kFlushInterval);
flush_timer_.async_wait(beast::bind_front_handler(
&EventOutbox::on_flush_timer, shared_from_this()));
}
Expand Down
2 changes: 1 addition & 1 deletion libs/internal/src/events/asio_event_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void AsioEventProcessor<SDK>::ScheduleFlush() {
LD_LOG(logger_, LogLevel::kDebug) << "event-processor: scheduling flush in "
<< flush_interval_.count() << "ms";

timer_.expires_from_now(flush_interval_);
timer_.expires_after(flush_interval_);
timer_.async_wait([this](boost::system::error_code ec) {
if (ec) {
LD_LOG(logger_, LogLevel::kDebug)
Expand Down
2 changes: 1 addition & 1 deletion libs/internal/src/events/request_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void RequestWorker::OnDeliveryAttempt(network::HttpResult const& result,
<< tag_ << "error posting " << batch_->Count()
<< " event(s) (will retry): HTTP error " << result.Status();
}
timer_.expires_from_now(retry_delay_);
timer_.expires_after(retry_delay_);
timer_.async_wait([this, callback](boost::system::error_code ec) {
if (ec) {
return;
Expand Down
2 changes: 1 addition & 1 deletion libs/server-sent-events/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class FoxyClient : public Client,

create_session();
create_parser();
backoff_timer_.expires_from_now(backoff_.delay());
backoff_timer_.expires_after(backoff_.delay());
backoff_timer_.async_wait(beast::bind_front_handler(
&FoxyClient::on_backoff, shared_from_this()));
}
Expand Down
Loading

0 comments on commit 42cc871

Please sign in to comment.