Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

SHiP post send_update to main thread to avoid overwhelming the main thread - develop-boxed #10550

Merged
merged 1 commit into from
Jul 20, 2021
Merged
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: 5 additions & 3 deletions plugins/state_history_plugin/state_history_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ struct state_history_plugin_impl : std::enable_shared_from_this<state_history_pl
fc_add_tag(span, "buffer_size", data.size());
this->derived_session().socket_stream->write(boost::asio::buffer(data));
});
callback(boost::system::error_code{}, "", [self = derived_session().shared_from_this()] {
self->send_update(::std::optional<::fc::zipkin_span>{});
});
app().post( priority::medium, [self = derived_session().shared_from_this()](){
self->callback( boost::system::error_code{}, "", [self] {
self->send_update( ::std::optional<::fc::zipkin_span>{} );
} );
} );
}
}

Expand Down