fiatjaf on Nostr: The reason for the goroutines is that results from different virtual queries must be ...
The reason for the goroutines is that results from different virtual queries must be returned in order, so we must do the queries in parallel then aggregate results from all of them partially instead of doing them in sequence and potentially returning results just from the first.
I am not claiming the way I did was the best possible, I would be glad to learn about better ways.
Published at
2024-09-27 12:46:56Event JSON
{
"id": "0000f5d3100bf4bf2a531a6e0a78e28307125d9b5d6f1012ae81c1e5598988a4",
"pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
"created_at": 1727441216,
"kind": 1,
"tags": [
[
"client",
"gossip"
],
[
"p",
"4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f"
],
[
"p",
"44dc1c2db9c3fbd7bee9257eceb52be3cf8c40baf7b63f46e56b58a131c74f0b"
],
[
"e",
"00001dc6bae57a40ed6eb9eacac346ea6a0aa22a092742f43b1b64d9d73b2f1b",
"wss://freelay.sovbit.host/",
"root"
],
[
"e",
"76390e6f2973f31ce92742329c54814761d4aed642d98809a131409d3f3fc36e",
"wss://wot.utxo.one/",
"reply"
],
[
"nonce",
"9529",
"16"
]
],
"content": "The reason for the goroutines is that results from different virtual queries must be returned in order, so we must do the queries in parallel then aggregate results from all of them partially instead of doing them in sequence and potentially returning results just from the first.\n\nI am not claiming the way I did was the best possible, I would be glad to learn about better ways.",
"sig": "2d1b8ef503c15fa9d90d1da526d8f922a1ef74b75d8afd3c40f634c8d837fb3dd442b728220fdeee1e60f8fcb957fe7874f153a4460ddf057d01a6f79bf01031"
}