wire-api-federation-0.1.0: The Wire server-to-server API for federation
Safe HaskellSafe-Inferred
LanguageGHC2021

Wire.API.Federation.BackendNotifications

Synopsis

Documentation

data BackendNotification Source #

NOTE: Stored in RabbitMQ, any changes to serialization of this object could cause notifications to get lost.

Constructors

BackendNotification 

Fields

fedNotifToBackendNotif :: forall {k} (tag :: k). (HasFedPath tag, HasVersionRange tag, KnownComponent (NotificationComponent k), ToJSON (Payload tag)) => RequestId -> Domain -> Payload tag -> BackendNotification Source #

Convert a federation endpoint to a backend notification to be enqueued to a RabbitMQ queue.

toBundle Source #

Arguments

:: forall {k} (tag :: k). (HasFedPath tag, HasVersionRange tag, KnownComponent (NotificationComponent k), ToJSON (Payload tag)) 
=> RequestId 
-> Domain

The origin domain

-> Payload tag 
-> PayloadBundle (NotificationComponent k) 

ensureQueue :: Channel -> Text -> IO () Source #

If you ever change this function and modify queue parameters, know that it will start failing in the next release! So be prepared to write migrations.

Internal machinery

newtype FedQueueClient c a Source #

Reads a servant request and puts the information in relevant RabbitMQ queue. Perhaps none of this should be servant code anymore. But it is here to allow smooth transition to RabbitMQ based notification pushing.

Use fedQueueClient to create an action and pass it to enqueue