Skip to content

Commit 77dcdaf

Browse files
authored
Update sidekiq jobs section
1 parent 7abb1c4 commit 77dcdaf

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

README.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,11 @@ clsas SomeInteractorJob
332332
SomeInteractor.call(*args)
333333
end
334334
end
335+
```
335336

336-
SomeInteractor.call(*args)
337-
code is changed to
338-
SomeInteractorJob.perform_async(*args)
337+
```diff
338+
-SomeInteractor.call(*args)
339+
+SomeInteractorJob.perform_async(*args)
339340
```
340341

341342
```ruby
@@ -347,14 +348,22 @@ class SomeInteractor
347348
# ...
348349
end
349350
end
351+
```
350352

351-
# no need to manually create a job class or handle the perform/call impedance mismatch
352-
SomeInteractor::Async.call(*args)
353+
No need to manually create a job class or handle the perform/call impedance mismatch
353354

354-
# This also makes it easy to add cron jobs to run interactors. As any interactor can be asyncified.
355-
# By using it's internal Async class.
355+
```diff
356+
-SomeInteractor.call!(*args)
357+
+SomeInteractor::Async.call!(*args)
356358
```
357359

360+
This also makes it easy to add cron jobs to run interactors. As any interactor can be asyncified.
361+
By using it's internal Async class.
362+
363+
N.B. as your class is now executing asynchronously you can no longer rely on its promises later on in the chain.
364+
365+
366+
358367
## FAQs
359368
- This is ugly isn't it?
360369

0 commit comments

Comments
 (0)