I'm trying to solve a problem and I thought I'd ask for help.
I've got a website using a WASM framework (dioxus) that gives me the ability to do async functions to fill in part of the web page. The web page renders immediately with either a placeholder or the result. I'm also using `nostr` and `nostr-sdk` from @Yuki Kishimoto
On one page I have a long list of events each by potentially a different npub. But initially I don't have any of their metadata. I want that page to fetch and fill in the metadata for all these people. This is a very typical (I'd say necessary) part of any web-based nostr client. I haven't done it yet though, I've done a desktop client.
The component on the page that renders the metadata is calling into this async function. Remember there are many of them, so many components are all nearly simultaneously calling into this async function, generally with different pubkeys but sometimes with the same pubkey.
The async function needs to either return metadata, or eventually return a failure.
A simple first idea that mostly works is to independently spin up a client and use it to two-step fetch the NIP-65 list from the discovery relay and then fetch the metadata from the user's relay. But this creates tons of clients and connections, saves nothing (no caching) and is generally regarded as a "bad idea."
The next iteration on the idea is to store a map from URL to Client and keep the client's alive. Then I can fetch the client (creating if missing) and fire off a new REQ. But this is still bad because I'm doing one request per pubkey and relays hate me saying I'm making too many requests.
So really I need to batch these somehow (multiple pubkeys per request). And to cache the results. And to be aware when some other thread is already doing this pubkey (and yet wait on it's result). And solving all of that simultaneously has been.... difficult.
I can have a map with pubkey as the key. And I can have the value be an enum either Fetching or Metadata (and missing from the map means it is not fetching). But no easy way to async wait on a map entry to show up. Also no easy way to wait a bit and then batch the multiple requests and avoid all race conditions with other threads doing the exact same thing (although that I can solve). Anyhow, the whole thing seems rather difficult and yet it must be solved by ... every web based nostr client out there... right?
Mike Dilger ☑️
mike@mikedilger.com
npub1acg6...p35c
Author of Gossip client: https://github.com/mikedilger/gossip
Dual National (USA / New Zealand)
My principles are Individualism, Equality, Liberty, Justice and Life
When you are at war, you keep fighting until a settlement is negotiated.
If the US is not at war with Russia, Trump quitting without a negotiated settlement is fine.
If the US is at war with Russia via it's proxy Ukraine, Trump quitting without a negotiated settlement is virtually treasonous.
I find it odd that people who claimed this was Ukraine's war not Americas are the ones most upset by Trump and calling him treasonous, whereas those of us who said this was a US proxy war seem to be okay with Trump just quitting. If you have any consistent morals, you'd say the opposite. Those saying it is Ukraine's war should be upset but accept that the US doesn't have to be involved and Trump hasn't committed any kind of high crime here. Those saying the US is in a proxy war with Russia should consider Trump to have committed a high crime by failing to continue fighting absent a negotiated settlement. At least it seems that way to me, I'm sure people will tell me I'm wrong if I am wrong.
Wet sycamore (plane tree) rounds kinda shred when split. The wood looks so solid and nice, and then the splitter breaks it into toothpicks.
Is it true that the US and Turkey arranged to ship thousands of Salafi Jihadist Uyghurs from Xinjiang China through Thailand to Turkey in 2015 and then into Idlib Syria to use to fight against Assad? And is it true that it is still happening (this year. after the fall of Assad) and Thailand has recently caught them and is returning them to China, and Marco Rubio is demanding Thailand let them travel onward to Turkey? And is it true that these "Uyghur Turkistan Islamic Party" members are slaughtering Christians in Syria, taking their homes, and desecrating their churches? Is the USA behind all of this?

Turkistan Islamic Party in Syria - Wikipedia

Voice of America
Rubio vows to oppose Thai Uyghur deportations as US secretary of state
Human rights advocates say Uyghurs returned to China risk torture, imprisonment, or disappearance
4700 Christians and Alawite civilians (including old people) slaughtered in Syria in recent days by the HTS government.
Iran refuses to hold talks with Trump due to threats. Qatar refuses to support a US strike on Iran's nuclear facilities.
Russian soldiers crawl through an oil pipeline to get behind Ukrainian forces in Kursk region.
I love how stock movements are always explained. Someone tweeted this not too long ago: "$GRND Grindr stock falling off a cliff as homosexuality continues to decline this week."
Nostr is the roads. Roads that lead to theatres and rubbish dumps, churches and whore houses. You choose where to go.
Daniel Hagari was one of the better IDF people. He covertly exposed to us multiple times how Israel was full of shit. Thank you Daniel.
People on nostr shouldn't be getting fooled by fake accounts. But I keep hearing about it. Multiple clients now will show you if a person is well-followed by your network or is a stranger with 0 followers. We need to get that feature into all the clients because apparently some people are falling for scams.
Humans are mostly wordcels. And James Lindsey kinda went crazy. I know those sentences don't sound related, but I will explain.
I was once challenged with the question "Why does a mirror preserve up and down, but flip left and right?" Any good shape rotator will know the answer: you are a wordcel if you think it is flipping anything other than front to back. Left and right are not the same kinds of things as up and down are. If you are facing north, the mirror is not flipping east and west. Your east arm matches your east arm, etc. My point is that humans are mostly wordcels. I didn't immediately comprehend the answer to this puzzle and it proved to me that I too am easily confused by language.
The amount of sincere confusion that can occur due to misuse of language is immense. Karl Marx and Engels started something that confused a lot of people. Later Foucault and Derrida and others really twisted it up even more, changing the meanings of words. It is not a simple thing you can recognize and rise above, because we think with language quite a lot. Again, we are mostly wordcels. After a signifcant amount of confusion, it is nearly impossible to right yourself.
James Lindsey (involved in the Sokal squared hoax) has spent an inordinate amount of time studying and understanding the nutty ideas that came out of Marxism. I believe that he understands them well. But I'm afraid that I don't understand James Lindsey anymore. He speaks in ways that are incomprehensible to me.
To be fair I haven't heard from James Lindsey in a few years, maybe he is less esoteric these days. But the thought came up because he is touring New Zealand and I was wondering if I should go to his talk. I decided against.
IMHO the right balance of coffee to milk is 1:1. Café noisette or at least Espresso macchiato.
The golden pager is a spying device.
If you are not failing regularly, then you are not trying enough challenging things.
O Panama, our home and native land... (oh wait, um...)