Skip to content
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

Async handler support for Slack::RealTime::Config and Client #486

Merged
merged 27 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
62b9fdb
Async cache build for Slack::RealTime::Stores::Store
milestruecar Jun 27, 2023
2881802
rubocop
milestruecar Jun 27, 2023
dccc45a
instead of asyncing one thing, async ALL the things
milestruecar Jun 27, 2023
5e878ab
remove stray logging line
milestruecar Jun 27, 2023
f3c1af0
run handlers loop in a single async task
milestruecar Jun 30, 2023
69a0966
Add support for async_handlers in Slack::RealTime::Config
milestruecar Jul 6, 2023
3795520
Merge branch 'master' into async-cache-build-485
milestruecar Jul 6, 2023
2664bff
remove log line
milestruecar Jul 6, 2023
9da3f7d
remove tricky send and just run it through a case statement
milestruecar Jul 6, 2023
feb221c
add Slack::RealTime::Config::InvalidAsyncHandlersError and messaging
milestruecar Jul 7, 2023
2c97c31
shorter error message
milestruecar Jul 7, 2023
70d2507
rspec: ensure Async::Task is returned when config#async_handlers is :all
milestruecar Jul 19, 2023
293bafe
Merge branch 'master' into async-cache-build-485
milestruecar Jul 20, 2023
9770b69
add async_handlers config option to README.md
milestruecar Jul 20, 2023
8be8667
rubocop
milestruecar Jul 20, 2023
e4f877b
be more explicit with ::Async
milestruecar Jul 20, 2023
770f526
Revert "be more explicit with ::Async"
milestruecar Jul 20, 2023
1810223
Merge branch 'master' into async-cache-build-485
milestruecar Jul 24, 2023
18fa984
implement run_async in RealTime::Concurrency::Async::Socket, add test…
milestruecar Aug 3, 2023
9d0e2a8
i mean this makes a passing test i guess
milestruecar Aug 3, 2023
14a1d58
more tests
milestruecar Aug 4, 2023
10446ed
rubocop, move test so i'm not making a redundant copy
milestruecar Aug 4, 2023
6079b0f
rubocop again
milestruecar Aug 4, 2023
3c627d1
Split async client specs. (#1)
dblock Aug 7, 2023
8e3706a
Merge branch 'master' into async-cache-build-485
milestruecar Aug 7, 2023
2d174c6
Fix: handle CONCURRENCY not being set (#2)
dblock Aug 7, 2023
85e6c9b
fix merge conflict
milestruecar Aug 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [#475](https://github.com/slack-ruby-client/pulls/475): Update API from [slack-api-ref@977dad5](https://github.com/slack-ruby/slack-api-ref/commit/977dad5) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#476](https://github.com/slack-ruby-client/pulls/476): Update API from [slack-api-ref@d0b2989](https://github.com/slack-ruby/slack-api-ref/commit/d0b2989) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#478](https://github.com/slack-ruby-client/pulls/478): Update API from [slack-api-ref@d797055](https://github.com/slack-ruby/slack-api-ref/commit/d797055) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#486](https://github.com/slack-ruby/slack-ruby-client/pull/486): Async cache build for slack::realtime::stores::store - [@milestruecar](https://github.com/milestruecar).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize and quote Slack::Realtime::... to match actual class name.

* Your contribution here.

### 2.1.0 (2023/03/17)
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/real_time/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def dispatch(event)
def run_handlers(type, data)
handlers = store.class.events[type.to_s]
handlers.each do |handler|
store.instance_exec(data, self, &handler)
Async.run { store.instance_exec(data, self, &handler) }
end
rescue StandardError => e
logger.error("#{self}##{__method__}") { e }
Expand Down
2 changes: 1 addition & 1 deletion lib/slack/real_time/stores/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def team
end

if caches.include?(:public_channels) || caches.include?(:private_channels) ||
caches.include?(:ims) || caches.include?(:mpims)
caches.include?(:ims) || caches.include?(:mpims)
types = CONVERSATION_TYPES.slice(*caches).values.join(',')
client.web_client.conversations_list(types: types) do |conversations|
conversations.channels.each do |channel_data|
Expand Down
Loading