Vitor Pamplona on Nostr: You should be able to turn any async into a sync call these days. On kotlin we use ...
You should be able to turn any async into a sync call these days. On kotlin we use coroutines for that. Even APIs that are based on callbacks can be suspended until the call back returns. It's just one or two lines of code. I am not sure how to do that on Dart and other languages though :(
I just don't think there is any future on having databases for each app. It just won't scale. In the end, they will all be slower than querying the local relay, which already has its indexes and most of the shared profiles and latest events in memory.
Published at
2025-01-03 14:53:18Event JSON
{
"id": "4b69f23b014469239482841af1d0912ff103312bcd9c72e837e8a5d86cb811b2",
"pubkey": "460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c",
"created_at": 1735915998,
"kind": 1,
"tags": [
[
"e",
"05e7fc88045568f680a574bc24daba3e3da3815ef9d6c10c8082c3fa9e4ac742",
"",
"root"
],
[
"e",
"ca1e63d4d6974b85cb8dcca8ef872695b3a0a17d33abeb6917baabc3e9181ea2"
],
[
"e",
"d8ee97fd6170e0561e67111adc42c5e9c05ab13b72c46e33e633df10ad98e308",
"",
"reply"
],
[
"p",
"726a1e261cc6474674e8285e3951b3bb139be9a773d1acf49dc868db861a1c11"
],
[
"p",
"460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c"
]
],
"content": "You should be able to turn any async into a sync call these days. On kotlin we use coroutines for that. Even APIs that are based on callbacks can be suspended until the call back returns. It's just one or two lines of code. I am not sure how to do that on Dart and other languages though :(\n\nI just don't think there is any future on having databases for each app. It just won't scale. In the end, they will all be slower than querying the local relay, which already has its indexes and most of the shared profiles and latest events in memory. ",
"sig": "d5a32011be4975c46d0f6425fba11d2b902ea8a7cf746d425a4b605303c54938a872f4555c188329dee26c8ac6ff4ea4b0af7c881e3b64f473e03ccce4de0d6c"
}