Instance Methodvapor 4.114.1Vapor

setWithAsyncShutdown(_:to:onShutdown:)

Set or remove a value for a given key, optionally providing an async shutdown closure for the value.

Storage.swift:114
mutating func setWithAsyncShutdown<Key>(_ key: Key.Type, to value: Key.Value?, onShutdown: ((Key.Value) async throws -> ())? = nil) async where Key : StorageKey

If a key that has a shutdown closure is removed by this method, the closure is invoked.