Published by mpyw almost 4 years ago
Drop support for stale versions (#20)
Published by mpyw about 4 years ago
Published by mpyw over 4 years ago
Published by mpyw over 4 years ago
Published by mpyw almost 5 years ago
Published by mpyw almost 5 years ago
$recordsModified
state if its value has not been changed
Published by mpyw almost 5 years ago
ShouldAssumeFresh
ShouldAssumeModified
are moved from Jobs
namespace to root.ShouldAssumeFresh
ShouldAssumeModified
now works not only for jobs but also for listeners, notifications and mailables.isRecentlyModified()
is not called when $recordsModified
is already set to true.JobInitializer
interface signature and its implementation have been changed.diff --git a/src/JobInitializers/JobInitializerInterface.php b/src/JobInitializers/JobInitializerInterface.php
index a2f6a97..d39a02c 100644
--- a/src/JobInitializers/JobInitializerInterface.php
+++ b/src/JobInitializers/JobInitializerInterface.php
@@ -3,6 +3,7 @@
namespace Mpyw\LaravelCachedDatabaseStickiness\JobInitializers;
use Illuminate\Queue\Events\JobProcessing;
+use Mpyw\LaravelCachedDatabaseStickiness\Events\ConnectionCreated;
/**
* Interface JobInitializerInterface
@@ -10,9 +11,17 @@
interface JobInitializerInterface
{
/**
- * Initialize database stickiness state before processing each job.
+ * Initialize database stickiness state on already resolved connections before processing each job.
*
* @param \Illuminate\Queue\Events\JobProcessing $event
*/
- public function initializeStickinessState(JobProcessing $event): void;
+ public function initializeOnResolvedConnections(JobProcessing $event): void;
+
+ /**
+ * Initialize database stickiness state on newly created connection before processing each job.
+ *
+ * @param \Illuminate\Queue\Events\JobProcessing $jobProcessingEvent
+ * @param \Mpyw\LaravelCachedDatabaseStickiness\Events\ConnectionCreated $connectionCreatedEvent
+ */
+ public function initializeOnNewConnection(JobProcessing $jobProcessingEvent, ConnectionCreated $connectionCreatedEvent): void;
}
AuthBasedResolver
now correctly works around with ResolveStickinessOnResolvedConnections
middleware.