Event JSON
{
"id": "76231f969b767e5650be6306a51370aa7cb06e4c49db96ff5bc5554c2a1743ef",
"pubkey": "979383f8767c5d795fcad86f82dc7b38b384c1a473710c433014dc2c0fb0e359",
"created_at": 1708178844,
"kind": 1,
"tags": [
[
"p",
"9dcbffc2bcb92de8bed74545288ac04e4d6011a56266fc7d7d663cb421102c61",
"wss://relay.mostr.pub"
],
[
"p",
"44ec8f9174ff3abe7bf0b21b37af11b7b036564d2d0d0ff3e48a3496e5adcf46",
"wss://relay.mostr.pub"
],
[
"e",
"5f21471506518f9353d03fe8946cdb85a292727cef7441f9005b15ec0eecc971",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://fosstodon.org/users/mo8it/statuses/111947208759631240",
"activitypub"
]
],
"content": "nostr:npub1nh9lls4uhyk730khg4zj3zkqfexkqyd9vfn0cltavc7tgggs93ssgsp2mr Arc of a trait object is inefficient 😅\n\nWhen working with a web server state, you normally create the state and don't drop it until it is dropped automatically at the end of the program. Therefore, I prefer to bypass using an Arc by intentionally \"leaking\" the state. Here is an example:\n\nhttps://codeberg.org/mo8it/oxitraffic/src/commit/8f26a82301937bbdbe383622fe3d15d99f368b79/src/app.rs#L28\n\nYou wrap the state in a Box and leak that Box to get a static reference \u0026'static State\n\nThis avoids the atomic incrementation in the reference counter.",
"sig": "71e1a0e0b3bd1b23b9dc3ec5568d7ff194786f2cfd7e3c35b2a744103482d0ac842e6564d7a9804951ede5d8a7d1d8beff70b3a6287c66dd10b15c70d058de2c"
}