-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Direct messages to Ratatouille. Is it implemented? #13
Comments
So officially, there are 3 ways to trigger an update and re-render (update is always followed by a render):
Unofficially, you could also achieve 1. above by manually sending the runtime an event (e.g., Could you elaborate on your use-case a bit? If none of these fit, I'd be happy to explore adding something new to address it. |
Ok, nothing fancy, for example, when building chat room I have a process that constantly receive messages and update needs to be triggered each time such messages received. Time interval subscription might be an option and it will do its job but it would feel slow due to low frequency update. It might be a ground for discussion whether or not TUI has to have immediate response, but for me it feels like positive answer. Oh, another case I almost forgot. I have GenServer having a process status wothin its state. 90% of the time it is idle and 10% either transmitting or receiving. It would be nice to have blinking which is not possible with time interval subscription. Work around with event might be a good option tho, havent though about it this way. PS. Btw, another thing which I find quite useful is logger backend for ratatouille. If I will manage to implement it I will create PR. Currently any output to console breaks the interface, if there are any guidelines or best practices I would appreciate it. |
@ADodulad You can use https://hex.pm/packages/logger_file_backend for logging. |
@ndreynolds Hi, Nick, Here is my use case: I have a WebSocket process that will send a message to its' subscriber. What would be the best approach to handle those events in Ratatouille app? |
Hi, how can I get the runtime PID to send messages? |
@ndreynolds and others, I'm working on an application which calls out to an external library from within Ratatouille. I need to share some state from this library and Ratatouille. Would this be a valid use case for the runtime event escape hatch? |
@brendalf You can start the process in your supervision tree with a transient strategy. I believe that pid is what you want. |
Is there a way to update model and trigger view rendering via direct message to Ratatouille without
Command
invocation?The text was updated successfully, but these errors were encountered: