esse-async_indexing 0.0.2 → 0.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/Gemfile +2 -1
  4. data/Gemfile.lock +18 -12
  5. data/README.md +50 -41
  6. data/lib/esse/async_indexing/actions/{batch_delete.rb → bulk_delete.rb} +2 -2
  7. data/lib/esse/async_indexing/actions/{batch_import.rb → bulk_import.rb} +1 -1
  8. data/lib/esse/async_indexing/actions/{batch_import_all.rb → bulk_import_all.rb} +1 -1
  9. data/lib/esse/async_indexing/actions/{batch_update.rb → bulk_update.rb} +6 -4
  10. data/lib/esse/async_indexing/actions/bulk_update_lazy_attribute.rb +19 -0
  11. data/lib/esse/async_indexing/actions/delete_document.rb +1 -1
  12. data/lib/esse/async_indexing/actions/index_document.rb +1 -1
  13. data/lib/esse/async_indexing/actions/update_document.rb +1 -1
  14. data/lib/esse/async_indexing/actions/upsert_document.rb +1 -2
  15. data/lib/esse/async_indexing/actions.rb +5 -7
  16. data/lib/esse/async_indexing/active_record_callbacks/lazy_update_attribute.rb +8 -5
  17. data/lib/esse/async_indexing/cli/async_import.rb +27 -18
  18. data/lib/esse/async_indexing/cli/async_update_lazy_attributes.rb +78 -0
  19. data/lib/esse/async_indexing/cli.rb +23 -9
  20. data/lib/esse/async_indexing/config.rb +0 -3
  21. data/lib/esse/async_indexing/configuration.rb +54 -18
  22. data/lib/esse/async_indexing/jobs/bulk_update_lazy_attribute_job.rb +7 -0
  23. data/lib/esse/async_indexing/jobs/import_all_job.rb +1 -1
  24. data/lib/esse/async_indexing/jobs/import_ids_job.rb +42 -0
  25. data/lib/esse/async_indexing/{workers.rb → jobs.rb} +7 -24
  26. data/lib/esse/async_indexing/tasks.rb +82 -0
  27. data/lib/esse/async_indexing/version.rb +1 -1
  28. data/lib/esse/async_indexing.rb +15 -20
  29. data/lib/esse/plugins/async_indexing.rb +18 -59
  30. metadata +19 -32
  31. data/lib/esse/async_indexing/actions/bulk_update_lazy_document_attribute.rb +0 -20
  32. data/lib/esse/async_indexing/actions/import_batch_id.rb +0 -21
  33. data/lib/esse/async_indexing/actions/update_lazy_document_attribute.rb +0 -14
  34. data/lib/esse/async_indexing/adapters/adapter.rb +0 -29
  35. data/lib/esse/async_indexing/adapters/faktory.rb +0 -114
  36. data/lib/esse/async_indexing/adapters/sidekiq.rb +0 -94
  37. data/lib/esse/async_indexing/adapters.rb +0 -12
  38. data/lib/esse/async_indexing/configuration/base.rb +0 -65
  39. data/lib/esse/async_indexing/configuration/faktory.rb +0 -6
  40. data/lib/esse/async_indexing/configuration/sidekiq.rb +0 -12
  41. data/lib/esse/async_indexing/jobs/bulk_update_lazy_document_attribute_job.rb +0 -7
  42. data/lib/esse/async_indexing/jobs/import_batch_id_job.rb +0 -34
  43. data/lib/esse/async_indexing/jobs/update_lazy_document_attribute_job.rb +0 -7
  44. data/lib/esse/async_indexing/testing.rb +0 -79
  45. data/lib/esse/async_indexing/worker.rb +0 -85
  46. data/lib/esse/async_indexing/workers/faktory.rb +0 -28
  47. data/lib/esse/async_indexing/workers/shared_class_methods.rb +0 -26
  48. data/lib/esse/async_indexing/workers/sidekiq.rb +0 -28
@@ -1,28 +0,0 @@
1
- # frizen_string_literal: true
2
-
3
- require_relative "shared_class_methods"
4
-
5
- module Esse::AsyncIndexing
6
- module Workers
7
- module Sidekiq
8
- def self.extended(base)
9
- base.include(::Sidekiq::Worker) if defined?(::Sidekiq)
10
- base.extend SharedClassMethods
11
- base.extend ClassMethods
12
- end
13
-
14
- module ClassMethods
15
- def service_worker_options
16
- default_queue = Esse.config.async_indexing.sidekiq.workers.dig(name, :queue)
17
- default_retry = Esse.config.async_indexing.sidekiq.workers.dig(name, :retry)
18
- default_queue ||= ::Sidekiq.default_worker_options["queue"] if defined?(::Sidekiq)
19
- default_retry ||= ::Sidekiq.default_worker_options["retry"] if defined?(::Sidekiq)
20
- {
21
- queue: default_queue || "default",
22
- retry: default_retry || 15
23
- }
24
- end
25
- end
26
- end
27
- end
28
- end