Minor tweaks / improvements to recent changelog/api docs [ci skip]
This commit is contained in:
parent
4939f39627
commit
8ad19d9865
@ -1,11 +1,12 @@
|
|||||||
* Record ping on every actioncable message
|
* Record ping on every Action Cable message.
|
||||||
|
|
||||||
Previously only `ping` and `welcome` message types were keeping connection active.
|
Previously only `ping` and `welcome` message types were keeping the connection active.
|
||||||
Now every Action Cable message updates `pingedAt` value preventing connection from being marked as stale.
|
Now every Action Cable message updates the `pingedAt` value, preventing the connection
|
||||||
|
from being marked as stale.
|
||||||
|
|
||||||
*yauhenininjia*
|
*yauhenininjia*
|
||||||
|
|
||||||
* Add two new assertion methods for ActionCable test cases: `assert_has_no_stream`
|
* Add two new assertion methods for Action Cable test cases: `assert_has_no_stream`
|
||||||
and `assert_has_no_stream_for`. These methods can be used to assert that a
|
and `assert_has_no_stream_for`. These methods can be used to assert that a
|
||||||
stream has been stopped, e.g. via `stop_stream` or `stop_stream_for`. They complement
|
stream has been stopped, e.g. via `stop_stream` or `stop_stream_for`. They complement
|
||||||
the already existing `assert_has_stream` and `assert_has_stream_for` methods.
|
the already existing `assert_has_stream` and `assert_has_stream_for` methods.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
A common mistake with Active Job is to enqueue jobs from inside a transaction,
|
A common mistake with Active Job is to enqueue jobs from inside a transaction,
|
||||||
causing them to potentially be picked and ran by another process, before the
|
causing them to potentially be picked and ran by another process, before the
|
||||||
transaction is committed, which result in various errors.
|
transaction is committed, which may result in various errors.
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
Topic.transaction do
|
Topic.transaction do
|
||||||
|
@ -9,12 +9,12 @@ module EnqueueAfterTransactionCommit # :nodoc:
|
|||||||
# :singleton-method:
|
# :singleton-method:
|
||||||
#
|
#
|
||||||
# Defines if enqueueing this job from inside an Active Record transaction
|
# Defines if enqueueing this job from inside an Active Record transaction
|
||||||
# automatically defers the enqueue to after the transaction commit.
|
# automatically defers the enqueue to after the transaction commits.
|
||||||
#
|
#
|
||||||
# It can be set on a per job basis:
|
# It can be set on a per job basis:
|
||||||
# - `:always` forces the job to be deferred.
|
# - `:always` forces the job to be deferred.
|
||||||
# - `:never` forces the job to be queueed immediately
|
# - `:never` forces the job to be queued immediately.
|
||||||
# - `:default` let the queue adapter define the behavior (recommended).
|
# - `:default` lets the queue adapter define the behavior (recommended).
|
||||||
class_attribute :enqueue_after_transaction_commit, instance_accessor: false, instance_predicate: false, default: :never
|
class_attribute :enqueue_after_transaction_commit, instance_accessor: false, instance_predicate: false, default: :never
|
||||||
|
|
||||||
around_enqueue do |job, block|
|
around_enqueue do |job, block|
|
||||||
|
@ -55,7 +55,7 @@ module ClassMethods
|
|||||||
# After the attempted enqueue, the job will be yielded to an optional block.
|
# After the attempted enqueue, the job will be yielded to an optional block.
|
||||||
#
|
#
|
||||||
# If Active Job is used conjointly with Active Record, and #perform_later is called
|
# If Active Job is used conjointly with Active Record, and #perform_later is called
|
||||||
# inside an Active Record transaction, then the enqueue is implictly defered to after
|
# inside an Active Record transaction, then the enqueue is implicitly deferred to after
|
||||||
# the transaction is committed, or droped if it's rolled back. This behavior can
|
# the transaction is committed, or droped if it's rolled back. This behavior can
|
||||||
# be changed on a per job basis:
|
# be changed on a per job basis:
|
||||||
#
|
#
|
||||||
|
@ -5,12 +5,12 @@ module QueueAdapters
|
|||||||
# = Active Job Abstract Adapter
|
# = Active Job Abstract Adapter
|
||||||
#
|
#
|
||||||
# Active Job supports multiple job queue systems. ActiveJob::QueueAdapters::AbstractAdapter
|
# Active Job supports multiple job queue systems. ActiveJob::QueueAdapters::AbstractAdapter
|
||||||
# form the abstraction layer which makes this possible.
|
# forms the abstraction layer which makes this possible.
|
||||||
class AbstractAdapter
|
class AbstractAdapter
|
||||||
# Define whether enqueuing should implictly to after commit when called from
|
# Defines whether enqueuing should happen implicitly to after commit when called
|
||||||
# inside a transaction. Most adapters should return true, but some adapters
|
# from inside a transaction. Most adapters should return true, but some adapters
|
||||||
# that use the same database as Active Record and are transaction aware can return
|
# that use the same database as Active Record and are transaction aware can return
|
||||||
# false to continue enqueuing jobs are part of the transaction.
|
# false to continue enqueuing jobs as part of the transaction.
|
||||||
def enqueue_after_transaction_commit?
|
def enqueue_after_transaction_commit?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
@ -29,7 +29,7 @@ def initialize # :nodoc:
|
|||||||
#
|
#
|
||||||
# If there is no currently open transactions, the block is called immediately.
|
# If there is no currently open transactions, the block is called immediately.
|
||||||
#
|
#
|
||||||
# If the current transaction has a parent transaction, the callback is transfered to
|
# If the current transaction has a parent transaction, the callback is transferred to
|
||||||
# the parent when the current transaction commits, or dropped when the current transaction
|
# the parent when the current transaction commits, or dropped when the current transaction
|
||||||
# is rolled back. This operation is repeated until the outermost transaction is reached.
|
# is rolled back. This operation is repeated until the outermost transaction is reached.
|
||||||
def before_commit(&block)
|
def before_commit(&block)
|
||||||
@ -40,7 +40,7 @@ def before_commit(&block)
|
|||||||
#
|
#
|
||||||
# If there is no currently open transactions, the block is called immediately.
|
# If there is no currently open transactions, the block is called immediately.
|
||||||
#
|
#
|
||||||
# If the current transaction has a parent transaction, the callback is transfered to
|
# If the current transaction has a parent transaction, the callback is transferred to
|
||||||
# the parent when the current transaction commits, or dropped when the current transaction
|
# the parent when the current transaction commits, or dropped when the current transaction
|
||||||
# is rolled back. This operation is repeated until the outermost transaction is reached.
|
# is rolled back. This operation is repeated until the outermost transaction is reached.
|
||||||
def after_commit(&block)
|
def after_commit(&block)
|
||||||
|
Loading…
Reference in New Issue
Block a user