: DispatcherImpl(name, api.threadFactory(), api.timeSource(), api.fileSystem(), time_system,
post_cb_(base_scheduler_.createSchedulableCallback([this]() -> void { runPostCallbacks(); })),
ASSERT(!watchdog_registration_, "Each dispatcher can have at most one registered watchdog.");
const std::string effective_prefix = prefix.has_value() ? *prefix : absl::StrCat(name_, ".");
// destroy in FIFO order so just do it manually. This required 2 passes over the vector which is
// For Linux, the source address' network namespace is relevant for client connections, since that
FileEventPtr DispatcherImpl::createFileEvent(os_fd_t fd, FileReadyCb cb, FileTriggerType trigger,
Event::SchedulableCallbackPtr DispatcherImpl::createSchedulableCallback(std::function<void()> cb) {
ENVOY_LOG(trace, "item added to deferred deletion list (size={})", current_to_delete_->size());
void DispatcherImpl::deleteInDispatcherThread(DispatcherThreadDeletableConstPtr deletable) {
// TODO(lambdai): Resolve https://github.com/envoyproxy/envoy/issues/15072 and loop delete below
// below 3 lists until all lists are empty. The 3 lists are list of deferred delete objects, post
__FUNCTION__, deferred_deletables_size, post_callbacks_size, thread_local_deletables_size);
void DispatcherImpl::updateApproximateMonotonicTime() { updateApproximateMonotonicTimeInternal(); }
// callback processing, and more easily detect if a scheduled post callback refers to one of the
// It is important that the execution and deletion of the callback happen while post_lock_ is not
// held. Either the invocation or destructor of the callback can call post() on this dispatcher.
for (auto iter = tracked_object_stack_.rbegin(); iter != tracked_object_stack_.rend(); ++iter) {
RELEASE_ASSERT(!tracked_object_stack_.empty(), "Tracked Object Stack is empty, nothing to pop!");