eldelshell | 3 years ago | on: Nuclear weapons are not as destructive as you think
eldelshell's comments
eldelshell | 4 years ago | on: Developers spend most of their time figuring the system out
eldelshell | 4 years ago | on: I wasted $40k on a fantastic startup idea (2020)
eldelshell | 4 years ago | on: Ask HN: Software with biggest potential for positive impact in 5 years?
eldelshell | 4 years ago | on: Server-sent events, WebSockets, and HTTP
You need to implement a server-side heartbeat feature.
You need to handle the close event from EventSource and be able to reconnect.
Tabs can be problematic. When you subscribe, you use a URL with a nominal ID to identify the client. For example, on a chat app, you would use /api/sse/userA/subscribe
Problem is, if userA starts opening tabs, each tab creates a new subscription for userA so you need to randomize each connection (userA-UUID).
If you don't use a nominal id, the server won't know to which subscriber to send the data and you don't want to broadcast all your chats.
I've used the Broadcast channel API in conjunction with SSE to have only one tab handle the SSE connection, and broadcast incoming SSEs to the other tabs which also reduces the number of connections to the server to one.
On the server it's also a PITA because not all instances/pods have the subscribers list. The way I've found to solve this is with clustering the instances with Hazelcast or Redis or a MQ.
But once you figure out all this, SSE works quite well.
eldelshell | 4 years ago | on: Server-sent events, WebSockets, and HTTP
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...
eldelshell | 4 years ago | on: Ask HN: Anyone making a living building desktop applications?
eldelshell | 4 years ago | on: Leetcode has taught me that I'm a bad engineer
Also, SWE is a highly movable profession, where being more than 5 years on the same place is unusual. So every ~5 years you have to polish your CV, grind LC and basically restart learning all computer science concepts you haven't used in those ~5 years, without feeling burnout or dismay.
eldelshell | 4 years ago | on: Leetcode has taught me that I'm a bad engineer
eldelshell | 4 years ago | on: Web3/Crypto: Why Bother?
eldelshell | 4 years ago | on: As an investor, why is crypto so hard to value?
With the US dollar, Euro and some others, the world is your casino (following the comparison) and you can trade all of them. Same with gold and silver (although this are a bit harder to trade).
Hell, try to pay a taxi in Djibouti, Sao Paolo or Islamabad with a BTC or USD and see which they'll accept and which will get you kicked out.
eldelshell | 4 years ago | on: “Open source” is broken
eldelshell | 4 years ago | on: Person Furious That Someone Right Click Saved Their Precious NFT
eldelshell | 4 years ago | on: Person Furious That Someone Right Click Saved Their Precious NFT
This is the best way to understand NFT.
eldelshell | 4 years ago | on: Red Hat forced to hire cheaper, less senior engineers amid budget freeze
eldelshell | 4 years ago | on: Ask HN: Is it unprofessional to leave a new job where everything is a mess?
eldelshell | 4 years ago | on: Ask HN: A US programmer makes 3 times that of a EU programmer. Why?
eldelshell | 4 years ago | on: Ask HN: A US programmer makes 3 times that of a EU programmer. Why?
Not sure this is the case but FYI.
eldelshell | 4 years ago | on: Ask HN: A US programmer makes 3 times that of a EU programmer. Why?
OTOH, we all know how some salaries are crazy high in high COL areas like SF, which I'm sure don't represent the whole of the US. I work with devs in Florida and NC that don't get pass the 6 figures.
eldelshell | 4 years ago | on: Amazon CEO unveils 55k tech jobs in his first hiring push