All Articles

HTMX, WebSockets, SignalR and you

31 Dec 2023
HTMX has gained some recent popularity. Lets explore how we can consume a SignalR Hub from a HTMX application.
This year's entry to Sergey Tihon's F# advent calendar. Thanks again :)

Managing your client connections in SignalR, including with authentication

09 Jul 2021
When using SignalR, one of the most important things will be to manage the various connections made by the clients, as well as being able to send messages to specific clients. SignalR offers three different ways of specifying connections and clients, each with their distinct usages. The question comes down when to use what, and the advantages and disadvantages offered by each.
Although this post is written with a focus on using F# and Fable.SignalR, the concepts talked about are applicable to SignalR in general, including when used with C#

Improving Real-time communication using Fable.SignalR

31 Dec 2020
Learn to use Fable.SignalR for a more functional and type-safe approach to communication over websockets when using Fabulous.Xamarin as the client.
This is a continuation of my previous blog post about real-time communication with Giraffe and Fabulous. Reading the other article is not required for this one, as it aims to accomplish the same thing, but using a nice friendly F# wrapper around SignalR. This post is also my entry for the F# advent calendar organized by Sergey Tihon. Once again a huge thanks to Sergey for organizing these every year. Awkwardly, Mark Allibone has also written an article for the advent calendar, which is very similar to my first post. Well, here's hoping we can learn something from each other.

Real-time communication with Giraffe and Fabulous

25 Oct 2020
Learn how to integrate SignalR with Fabulous to give your xamarin apps written in F# real-time interactivity.
Real-time communication can make any application that much more interactive. Whether it be a simple chat application, or other notifications that are pushed live to the client, there is a significant improvement in the user experience when this information is pushed in real-time to the client without the need for a page refresh, or specifically having to pull this data. In many user facing applications, this is usually accomplished using WebSocket protocol. And in the .Net space, the dominant library for WebSocket support is SignalR. SignalR provides a number of advantages over directly using WebSockets, because it provides several features on top. Some of these features include improved connection management (e.g. how to handle reconnecting), sending messages to all or only some clients, and built-in scaling. Additionally, SignalR can automatically fallback to Server-sent events or Long-Polling depending on what the client supports.