Subject: Clean architecture with MatriX
Hi,
First congratulations for this wonderful library. I am considering using it in a project as this is the best library I've seen.
My question is more on how to use Matrix in an existing project than on how Matrix works. Since all operations in Matrix are done asynchronously (except if we use SendIqSynchronous), we would need to subscribe from the UI to a lot of events to know if the operation was successful (for some we don't care, like sending a message, however for others like creating a chat room, we want to know if the creation process was successful).
So in the end, we would have dozens of events like RoomCreated, RoomJoined, ParticipantStatusChanged, etc.
This design makes it difficult to execute a sequence of commands like: connect, join room enter room. We end up with a kind of state machine (at each step, the UI gets the next event).
So my question is: is there a way to have a clean design with such an aynchronous design? I didn't find the answer in the examples nor in this forum. So thank you if someone can explain me how to have a clean and efficient design.
First congratulations for this wonderful library. I am considering using it in a project as this is the best library I've seen.
My question is more on how to use Matrix in an existing project than on how Matrix works. Since all operations in Matrix are done asynchronously (except if we use SendIqSynchronous), we would need to subscribe from the UI to a lot of events to know if the operation was successful (for some we don't care, like sending a message, however for others like creating a chat room, we want to know if the creation process was successful).
So in the end, we would have dozens of events like RoomCreated, RoomJoined, ParticipantStatusChanged, etc.
This design makes it difficult to execute a sequence of commands like: connect, join room enter room. We end up with a kind of state machine (at each step, the UI gets the next event).
So my question is: is there a way to have a clean design with such an aynchronous design? I didn't find the answer in the examples nor in this forum. So thank you if someone can explain me how to have a clean and efficient design.