APIServerWorker class final
- Inheritance
-
- Object
- APIServerConfig
- APIServerWorker
Constructors
- APIServerWorker(int workerIndex, APIRoot apiRoot, {required String? name, required String? version, String? address, int? port, int? securePort, Object? domains, Object? letsEncryptDirectory, bool letsEncrypt = false, bool? letsEncryptProduction, bool? allowRequestLetsEncryptCertificate, bool hotReload = false, int? totalWorkers = 1, bool? cookieless, bool? useSessionID, String? apiCacheControl, String? staticFilesCacheControl, String? longLivedStaticFilesCacheControl, Object? longLivedStaticFilesCached, bool? cacheStaticFilesResponses, int? staticFilesCacheMaxMemorySize, int? staticFilesCacheMaxContentLength, int? maxPayloadLength, bool? decompressPayload, Duration? serverResponseDelay, bool? logToConsole, bool? logQueue})
Properties
- address → String
-
The bind address of this server.
finalinherited
- allowRequestLetsEncryptCertificate → bool
-
If
trueallows the request of Let's Encrypt certificates.finalinherited - apiCacheControl → String
-
The
cache-controlheader for API responses.finalinherited - apiConfig → APIConfig?
-
The APIConfig of the APIRoot.
finalinherited
- apiInfoURL → String
-
The local
API-INFOURL of this server.no setterinherited - apiRoot → APIRoot
-
The API root of this server.
finalinherited
- args → ArgsSimple
-
All the parsed arguments, using
ArgsSimple.finalinherited - cacheStaticFilesResponses → bool
-
If
truewill cache static files. Default: truefinalinherited - canUseLetsEncrypt → bool
-
Returns
trueif the basic conditions for Let's Encrypt are configured.no setterinherited -
If
truewill remove anySet-CookieorCookieheader.finalinherited - decompressPayload → bool
-
Whether to decompress the request payload if it is compressed using
a supported
Content-Encoding(e.g., gzip or deflate).finalinherited - development → bool
-
finalinherited
-
domains
→ List<
String> -
Returns a list of domains at domainsRoots keys (non RegExp entries).
no setterinherited
-
domainsRoots
→ Map<
Pattern, Directory> -
The domains root directories.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasMultipleWorkers → bool
-
no setter
- hotReload → bool
-
If
trueenables Hot Reload (APIHotReload.enable).finalinherited - id → int
-
ID of this instance.
latefinalinherited
- isAuxiliaryWorker → bool
-
no setter
- isMainWorker → bool
-
no setter
- isStarted → bool
-
Returns
trueif this servers is started.no setterinherited - isStarting → bool
-
Returns
trueif this instance is currently in the process of starting.no setterinherited - isStopped → bool
-
Returns
trueif this server is closed.typeno setterinherited - letsEncrypt → bool
-
If
trueenabled Let's Encrypt.finalinherited - letsEncryptDirectory → Directory?
-
The Let's Encrypt certificates Directory.
finalinherited
- letsEncryptProduction → bool
-
If
trueruns Let's Encrypt in production mode.finalinherited - logQueue ↔ bool
-
If
falsedisables log flush queue.latefinalinherited - logToConsole ↔ bool
-
If
truelog messages to stdout (console).latefinalinherited - longLivedStaticFilesCacheControl → String
-
The
cache-controlfor long-lived static files. See longLivedStaticFilesCached.finalinherited -
longLivedStaticFilesCached
→ List<
Pattern> -
Patterns of files using longLivedStaticFilesCacheControl.
See staticFilesCacheControl.
finalinherited
- maxPayloadLength → int?
-
The maximum allowed request payload size in bytes.
finalinherited
- name → String
-
The name of this server.
finalinherited
- port → int
-
The listen port of this server (HTTP).
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- securePort → int
-
The listen secure port of this server (HTTPS).
finalinherited
- serverName → String
-
The
serverheader value.no setterinherited - serverResponseDelay → Duration?
-
A forced delay in each server response.
Only active if development is
true.finalinherited - staticFilesCacheControl → String
-
The
cache-controlheader for static files.finalinherited - staticFilesCacheMaxContentLength → int
-
The maximum
Content-Length(in bytes) allowed for a cachedResponse. Default: 10Mfinalinherited - staticFilesCacheMaxMemorySize → int
-
The maximum memory size (in bytes) for storing all cached
Responses. Default: 50Mfinalinherited - totalWorkers → int
-
The number of APIServerWorker instances to spawn.
finalinherited
- url → String
-
The local URL of this server.
no setterinherited
- urlHost → String
-
The host of
url;no setterinherited - useSessionID → bool
-
If
truethe server will use/generate aSESSIONIDfor each request. Iffalsewill ignore anySESSIONIDcookie (useful to comply with cookieless servers).finalinherited - version → String
-
The version of this server.
finalinherited
- workerDebugName → String
-
no setter
- workerIndex → int
-
final
Methods
-
isLongLivedStaticFileCached(
String filePath) → bool -
Returns
trueiffilePathmatches any pattern in longLivedStaticFilesCached. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
spawnIsolate(
) → Future< (Isolate?, PortListener?, SendPort?, Future< bool> ?)> -
start(
) → Future< bool> -
Starts this server.
inherited
-
stop(
) → Future< void> -
Stops/closes this server.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
override
-
waitStopped(
) → Future< bool> -
Returns a Future that completes when this server stops.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- initializationTimeout → const Duration