You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/WebPush/WebPushManager.swift
+48-2Lines changed: 48 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,21 +15,47 @@ import NIOCore
15
15
import NIOPosix
16
16
import ServiceLifecycle
17
17
18
+
/// A manager for sending push messages to subscribers.
19
+
///
20
+
/// You should instantiate and keep a reference to a single manager, passing a reference as a dependency to requests and other controllers that need to send messages. This is because the manager has an internal cache for managing connections to push services.
21
+
///
22
+
/// The manager should be installed as a service to wait for any in-flight messages to be sent before your application server shuts down.
18
23
publicactorWebPushManager:Sendable{
24
+
/// The VAPID configuration used when configuring the manager.
19
25
publicletvapidConfiguration:VAPID.Configuration
20
26
21
27
/// The maximum encrypted payload size guaranteed by the spec.
28
+
///
29
+
/// Currently the spec guarantees up to 4,096 encrypted bytes will always be successfull.
30
+
///
31
+
/// - Note: _Some_, but not all, push services allow an effective encrypted message size that is larger than this, as they misinterpreted the 4096 maximum payload size as the plaintext maximum size, and support the larger size to this day. This library will however warn if this threshold is surpassed and attempt sending the message anyways — it is up to the caller to make sure messages over this size are not regularly attempted, and for fallback mechanisms to be put in place should push result in an error.
22
32
publicstaticletmaximumEncryptedPayloadSize=4096
23
33
24
34
/// The maximum message size allowed.
35
+
///
36
+
/// This is currently set to 3,993 plaintext bytes. See the discussion for ``maximumEncryptedPayloadSize`` for more information.
0 commit comments