Skip to content

Releases: mpyw/laravel-cached-database-stickiness

v2.1.0

13 Mar 08:35
e9395ca
Compare
Choose a tag to compare
chore: 🤖 Drop support for stale versions

v2.0.1

14 Jul 19:29
f4b2c6c
Compare
Choose a tag to compare
Support for Laravel 10 (#25)

v2.0.0

25 Jan 09:02
0a25a34
Compare
Choose a tag to compare

Drop support for stale versions (#20)

v1.0.3

06 Oct 07:40
7b7ab22
Compare
Choose a tag to compare

v1.0.2

12 Mar 08:21
eeb5004
Compare
Choose a tag to compare

v1.0.1

10 Mar 18:59
baf1178
Compare
Choose a tag to compare

v0.3.1

17 Jan 13:00
ad72925
Compare
Choose a tag to compare

v0.3.0

08 Jan 06:49
360b904
Compare
Choose a tag to compare

Fix: Restore $recordsModified state if its value has not been changed

  • Initialization effects are automatically revoked only if the Job does not change the stickiness state.

v0.2.0

02 Jan 15:48
59cdf0e
Compare
Choose a tag to compare

[BC] Add ability to detect interfaces on listeners, nofications and mailables #2

  • ShouldAssumeFresh ShouldAssumeModified are moved from Jobs namespace to root.
  • ShouldAssumeFresh ShouldAssumeModified now works not only for jobs but also for listeners, notifications and mailables.

Add ability to retrieving $recordsModified and optimize calls for resolver #5

  • For performance optimization, isRecentlyModified() is not called when $recordsModified is already set to true.

[BC] Fix workers problem #6

  • JobInitializer interface signature and its implementation have been changed.
  • Stickiness on Connection resolved during Job execution is now correctly reset.
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;
 }

Add Stickiness Resolver Middleware #7

  • AuthBasedResolver now correctly works around with ResolveStickinessOnResolvedConnections middleware.