diff --git a/3.0/docs/async/package.md b/3.0/docs/async/package.md index e50faec3..ca9fd2a1 100644 --- a/3.0/docs/async/package.md +++ b/3.0/docs/async/package.md @@ -4,7 +4,6 @@ Async is a library revolving around two main concepts: - [Promises and Futures](futures.md) - [Streams](streams.md) -- [Workers](worker.md) Together they form the foundation of Vapor 3's data flow. diff --git a/3.0/docs/async/worker.md b/3.0/docs/async/worker.md deleted file mode 100644 index b8fe9aad..00000000 --- a/3.0/docs/async/worker.md +++ /dev/null @@ -1,11 +0,0 @@ -# Worker - -Workers are any type that keep track of the current [EventLoop](../concepts/async.md). - -Worker is a simple protocol and can be conformed to if the context can return (by means of a computed property) or contain an EventLoop. - -There are three primary Workers that you can use to access the `EventLoop` and it's queue or context. - -- [Request](../http/request.md) can be used, usually from within a [Route](../routing/basics.md) -- [EventLoop](../concepts/async.md) is itself a worker to ensure the extensions and consumers of Worker can be used, too. -- `DispatchQueue` is a worker that will return a *new and clean* EventLoop based on the current DispatchQueue diff --git a/3.0/docs/concepts/services.md b/3.0/docs/concepts/services.md index 130d4c48..b7c9a07f 100644 --- a/3.0/docs/concepts/services.md +++ b/3.0/docs/concepts/services.md @@ -74,3 +74,11 @@ If we set Vapor's environment to development we'll get an instance of `VerboseLo let logger = container.make(Logger.self) logger.log("hello", level: .verbose) // only logs on development ``` + +## Containers + +Containers are types that contain the current context. They have access to the services, environment, configuration and [EventLoop](async.md) and can use these to `.make()` new service types. + +The factory method registered to a service will get access to the container's Context during the creation of type. + +There are a few containers that are often accessed, the primary `Container` type for Vapor users is [`Request`](../http/request.md), which can be accessed in every [`Route`](../routing/route.md). diff --git a/3.0/mkdocs.yml b/3.0/mkdocs.yml index a2e7c6ba..d6aed25b 100644 --- a/3.0/mkdocs.yml +++ b/3.0/mkdocs.yml @@ -29,7 +29,6 @@ pages: - 'Package': 'async/package.md' - 'Futures': 'async/futures.md' - 'Streams': 'async/streams.md' - - 'Worker': 'async/worker.md' - 'HTTP': - 'Package': 'http/package.md' - 'Body': 'http/body.md'