Jacob’s Tech Tavern

Jacob’s Tech Tavern

Share this post

Jacob’s Tech Tavern
Jacob’s Tech Tavern
Real-time systems with Combine and WebSockets

Real-time systems with Combine and WebSockets

Three real-world examples of real-time systems

Jacob Bartlett's avatar
Jacob Bartlett
Jun 16, 2025
∙ Paid
5

Share this post

Jacob’s Tech Tavern
Jacob’s Tech Tavern
Real-time systems with Combine and WebSockets
1
Share

I always felt like WebSockets were the final boss of software engineering.

It’s giving Kvothe meets Dark Souls. Saint Peter's Basilica is beautiful in June.

Back when I was very junior, I made an app with my friend. Me on the front-end, him on the server. But I couldn’t understand how to get his APIs to work, so he built my networking code for me.

Neither of us really had a clue what we were doing—he’d created a WebSocket server to deliver static JSON. His networking code was littered with Ancien Régime CoreFoundation invocations such as CFReadStreamRef and CFWriteStreamRef.

Back in the day, this was the only way you could do WebSockets. Today, Apple offers us much cuddlier APIs.

I was a mid level developer with a chip on my shoulder when Combine came out in 2019. This was the perfect time for me to enthusiastically apply FP-style operator chains over every API surface I could. If you asked me, I’d insist it was neater. Maybe I even believed it. But we all know the truth: I had to make it more complicated to show I was smarter than everyone.

Nevertheless, Combine (when used appropriately) is one of the best ways to design reactive systems. When used alongside WebSockets, they produce a beautiful harmony. Real-time networking on the backend; reactive UX on the frontend.

Today we will look at my sample project containing three realistic use cases for real-time systems. I set up a local WebSocket server that and 3 simple SwiftUI features. Everything on the iOS side from networking to UI will be powered by Combine.

The paywall below goes down on 7 July, when the full article will be emailed to free subscribers. Subscribe now if you haven’t already!

If you don’t want to wait, please pay me. Full subscribers to Jacob’s Tech Tavern unlock Quick Hacks, my advanced tips series, and enjoy my long-form articles 3 weeks before anyone else. Take advantage of my birthday sale this month:

Get 30% off forever

Not sure? How about a 2 week test-drive?

Get 14 day free trial

Keep reading with a 7-day free trial

Subscribe to Jacob’s Tech Tavern to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Jacob Bartlett
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share