mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 05:53:55 +08:00
d8d756cd2f
This commit introduces the possibility to stream messages. To allow plugins to use streaming this commit also ships a `ChatSDK` library to allow to interact with few parts of discourse chat. ```ruby ChatSDK::Message.create_with_stream(raw: "test") do |helper| 5.times do |i| is_streaming = helper.stream(raw: "more #{i}") next if !is_streaming sleep 2 end end ``` This commit also introduces all the frontend parts: - messages can now be marked as streaming - when streaming their content will be updated when a new content is appended - a special UI will be showing (a blinking indicator) - a cancel button allows the user to stop the streaming, when cancelled `helper.stream(...)` will return `false`, and the plugin can decide exit early |
||
---|---|---|
.. | ||
add_users_to_channel_spec.rb | ||
auto_join_channel_batch_spec.rb | ||
create_category_channel_spec.rb | ||
create_direct_message_channel_spec.rb | ||
create_message_spec.rb | ||
create_thread_spec.rb | ||
flag_message_spec.rb | ||
invite_users_to_channel_spec.rb | ||
leave_channel_spec.rb | ||
list_channel_messages_spec.rb | ||
list_channel_thread_messages_spec.rb | ||
lookup_channel_threads_spec.rb | ||
lookup_thread_spec.rb | ||
lookup_user_threads_spec.rb | ||
mark_all_user_channels_read_spec.rb | ||
message_destroyer_spec.rb | ||
publisher_spec.rb | ||
restore_message_spec.rb | ||
search_chatable_spec.rb | ||
stop_message_streaming_spec.rb | ||
tracking_state_spec.rb | ||
trash_channel_spec.rb | ||
trash_message_spec.rb | ||
unfollow_channel_spec.rb | ||
update_channel_spec.rb | ||
update_channel_status_spec.rb | ||
update_message_spec.rb | ||
update_thread_notification_settings_spec.rb | ||
update_thread_spec.rb | ||
update_user_last_read_spec.rb | ||
update_user_thread_last_read_spec.rb | ||
upsert_draft_spec.rb |