writing a misskey client #17
Replies: 3 comments 8 replies
-
Wow, that looks awesome! Have you read this chapter in the book? https://aaronerhardt.github.io/relm4-book/book/threads_and_async.html It seems to me that either using an async worker or spawning a new thread with a tokio runtime could be an even better option. |
Beta Was this translation helpful? Give feedback.
-
i'm still learning how rusts async works, it's pretty new as i'm used to other languages with promises and generally more reference counting. i tried to implement it as an async worker yesterday but kept running into trouble, mainly in that i somehow made it blocking. for now a simple approach where each avatar makes it's own http request is fine, but i'll definitely be revisiting it as i learn more. one thing i have not yet worked out and i'm not sure if it's possible, can factories have components? I get that factories work well for simple lists and maybe not for something as complex as a twitter/misskey/mastodon timeline, but i'm not sure what the alternative is? anyhow, that's what i'll be poking at today, more async stuff and investigating the above. here's a screenshot from where i left it last night: |
Beta Was this translation helpful? Give feedback.
-
anyhow, here's the code so everyone can see the mess i'm making: https://github.com/bunnegirl/bunnieverse |
Beta Was this translation helpful? Give feedback.
-
yesterday i started writing a client for misskey, i've made quite a lot of progress and learned a fair bit, this being my first gui program.
i have a lot more left to do, but the basics of the home timeline are done, as is async loading of user avatars which was quite a challenge. i tried several things, including doing the async fetch before populating the gui, but in the end the best/cleanest way was to use
spawn_future
in my timeline factory, send a message to the parent component to update the factory data, and finally use the factory'supdate
method to change the actual widgets.(writing this out in case anyone googles this later)
thanks for your hard work, i'm really happy with how easy this was to pick up and how much it can do.
Beta Was this translation helpful? Give feedback.
All reactions