ServiceStack Pub/Sub 通过 Api

ServiceStack Pub/Sub via Api

是否可以通过 api 设置发布订阅?我打算使用 redis,但我不想将它暴露给 WWW(安全问题)。我想让订阅者通过我的 Api 加入,这样我就可以处理身份验证和授权,但我不确定这是否可能?我可以使用 SignalR 之类的东西让客户端通过 api 订阅总线吗?

您可以使用 ServiceStack Server Events to enable pub/sub real-time notifications over the Internet. It includes an JavaScript client for enabling real-time notifications to Ajax clients as well as a typed .NET Server Events Client for real-time notifications for C#/.NET PCL Clients, including support for Xamarin.Android 和 Xamarin.iOS 客户端。

默认情况下,它使用内存服务器事件实现,但还有一个 Redis-server backed Server Events 直接替换,这将允许在多个负载平衡的应用服务器上订阅同一频道。

Server Event Examples 包含几个示例和现场演示,展示了使用服务器事件可能实现的实时通知。