async_block 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18e0e1824a1ab945b463420a2e016fdbe18f6d43495ca65709f4a52c74f0e745
4
- data.tar.gz: b60005b7644181beb5758ad9414439901dfa93ce58b860095a065b59c98eb06b
3
+ metadata.gz: 2130f23729cead7cdd271b467edc3f5ab940cb2dd121e7b0bdeb6e4b37fa1eb1
4
+ data.tar.gz: 8e7d3d8321f8575d64781aa1b61518d7ffbfe4fd9cbd8a63f45a4317fe8c606a
5
5
  SHA512:
6
- metadata.gz: 1ca350e098475197eba58efabd2e995a99e113c9b74504f78756e998cf38b8442af317b77ac9c93e519ce5e98c6a02e6e5dc549c6846ac1b487ffce6cdbd0d51
7
- data.tar.gz: 62c2ce631bda1ab60f14b1fd832ddda2742730699669061ca8d634b4cec297f7114dd4c5ffc552b37d3f1af925577ab661f68255a10373babaf517b5254979e2
6
+ metadata.gz: 2034c98fa200ee440f9cec18cf4b78892798048739af52dcede0b01c6fbe7282bec4e9b346843f6f13d3661a9d012773ac722af2e28d3e95020c27e8644088de
7
+ data.tar.gz: d93484c7759261ae68290bc7bbdf6c6a6961ee6dc857b8d42b981fe7fe3399fb9a4d4a98352bec3efa32ccfc741f44521f03467c2aa1b0b11e45f7faeadc4b0e
data/README.md CHANGED
@@ -18,7 +18,7 @@ Add your code in wrapped inside AsyncBlock as described below.
18
18
  \*\* NOTE - AsyncBlock cannot be executed from irb/console
19
19
 
20
20
  ```
21
- AsyncBlock.perform do
21
+ AsyncBlock.run do
22
22
  puts('This is running in a temporary job')
23
23
  puts('Put your code below')
24
24
  end
@@ -27,7 +27,7 @@ end
27
27
  To put some delay on the async execution (say 5 minutes):
28
28
 
29
29
  ```
30
- AsyncBlock.perform(delay: 5.minutes) do
30
+ AsyncBlock.run(delay: 5.minutes) do
31
31
  puts('This is running in a temporary job')
32
32
  puts('Put your code below')
33
33
  end
@@ -36,7 +36,7 @@ end
36
36
  To explicitly mention a queue for the async execution:
37
37
 
38
38
  ```
39
- AsyncBlock.perform(delay: 1.minute, queue: 'p3') do
39
+ AsyncBlock.run(delay: 1.minute, queue: 'p3') do
40
40
  puts('This is running in a temporary job')
41
41
  puts('Put your code below')
42
42
  end
@@ -21,7 +21,7 @@ module AsyncBlock
21
21
  end
22
22
 
23
23
  def execute_block!(block)
24
- block.call
24
+ block&.call
25
25
  end
26
26
  end
27
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AsyncBlock
4
- VERSION = '0.2.6'
4
+ VERSION = '0.2.7'
5
5
  end
data/lib/async_block.rb CHANGED
@@ -10,7 +10,7 @@ require_relative 'async_block/async_wrapper_job'
10
10
  module AsyncBlock
11
11
  class Error < StandardError; end
12
12
 
13
- def self.perform(queue: nil, delay: nil, &block)
13
+ def self.run(queue: nil, delay: nil, &block)
14
14
  source = BlockToSource.new(block).convert
15
15
  queue ||= DEFAULT_QUEUE_NAME
16
16
  if delay.instance_of?(ActiveSupport::Duration)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async_block
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adittya Dey