UpdateNotificationModifier
public final class UpdateNotificationModifier<
A: UpdateEndpoint>:
UpdateEndpoint, RestEndpointModifier where A.QuerySubject: NotificationProtocol
A class that wraps a component which utilizes a .notify() modifier. That
allows Corvus to chain modifiers, as it gets treated as any other struct
conforming to CreateEndpoint. Requires an object A that represents the
message to send.
-
The return type for the
.handler()modifier.Declaration
Swift
public typealias Element = A.Element -
The return value of the
.query(), so the type being operated on in the current component.Declaration
Swift
public typealias QuerySubject = A.QuerySubject -
The instance of
EndpointtheUpdateNotificationModifieris modifying.Declaration
Swift
public let modifiedEndpoint: A -
Initializes the modifier with its underlying
QueryEndpointDeclaration
Swift
public init(_ notificationEndpoint: A)Parameters
notificationEndpointThe
QueryEndpointto which the modifer is attached. -
A default implementation of
.query()for components that do not require customized database queries.Throws
An error if something goes wrong.Declaration
Swift
public func query(_ req: Request) throws -> QueryBuilder<QuerySubject>Parameters
reqThe incoming
Request.Return Value
A
QueryBuilderobject for further querying. -
A method which sends the message supplied in the
Requestas a push notification.Throws
An error if something goes wrong.Declaration
Swift
public func handler(_ req: Request) throws -> EventLoopFuture<Element>Parameters
reqAn incoming
Request.Return Value
An
EventLoopFuturecontaining an eagerloaded value as defined byElement.
View on GitHub
UpdateNotificationModifier Class Reference