// Copyright (c) 2017-2022 Cloudflare, Inc. // Licensed under the Apache 2.0 license found in the LICENSE file or at: // https://opensource.org/licenses/Apache-2.0 #pragma once #include #include namespace workerd { class IoChannelFactory; class LimitEnforcer; class RequestObserver; class ThreadContext; class WorkerInterface; class BaseTracer; namespace tracing { class InvocationSpanContext; }; // Create and return a wrapper around a Worker that handles receiving a new event // from the outside. In particular, // this handles: // - Creating a IoContext and making it current. // - Executing the worker under lock. // - Catching exceptions and converting them to HTTP error responses. // - Or, falling back to proxying if passThroughOnException() was used. // - Finish waitUntil() tasks. kj::Own newWorkerEntrypoint(ThreadContext& threadContext, kj::Own worker, kj::Maybe entrypointName, Frankenvalue props, kj::Maybe> actor, kj::Own limitEnforcer, kj::Own ioContextDependency, kj::Own ioChannelFactory, kj::Own metrics, kj::TaskSet& waitUntilTasks, bool tunnelExceptions, kj::Maybe> workerTracer, kj::Maybe cfBlobJson, kj::Maybe versionInfo, // The trigger invocation span may be propagated from other request. If it is provided, // the implication is that this worker entrypoint is being created as a subrequest or // subtask of another request. If it is kj::none, then this invocation is a top-level // invocation. kj::Maybe maybeTriggerInvocationSpan = kj::none, bool isDynamicDispatch = false); } // namespace workerd