Interface Notification
- All Known Implementing Classes:
StandardNotification
public interface Notification
Once configured, this will perform the action to finally send the
Notification. Like instances of
NotificationBuilder, instances will be short-lived and are not guaranteed to be thread-safe. Once a
Notification has been sent, the object should be disposed of.-
Method Summary
Modifier and TypeMethodDescriptiondefault intsend()Invokessend(Consumer, Consumer)with callbacks which simply logs the result.intsend(Consumer<NotificationEvent> success, Consumer<Exception> failure) Enqueues thisNotificationto be sent.
-
Method Details
-
send
default int send()Invokessend(Consumer, Consumer)with callbacks which simply logs the result. -
send
Enqueues thisNotificationto be sent. This call may block, but should return as reasonably quickly as possible. This does not guarantee delivery, and may drop the message without reporting an error if necessary but should make all reasonable efforts to ensure the message has been sent. For example, this may ensure that the message was received by the underlying message service but will not provide a guarantee that it was delivered when it returns. Not that either lambda may be called multiple times, or never called.- Parameters:
success- called when a message was successfully sent, note this may be called multiple timesfailure- called when a message failed- Returns:
- the number of destinations that recieved the
Notification
-