Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.6] Event Architecture #589

Merged
merged 5 commits into from
Oct 27, 2022
Merged

[9.6] Event Architecture #589

merged 5 commits into from
Oct 27, 2022

Conversation

rez1dent3
Copy link
Member

@rez1dent3 rez1dent3 commented Oct 15, 2022

Thanks to the new functionality in the laravel framework (adding a committing event), it became possible to solve all the old problems of the package. And this is full support for laravel nova. The package actively helps you deal with the race condition. Before version 9.6, only with the help of AtomicServiceInterface it was possible to block the wallet for the duration of useful work, and later apply or roll back the transaction, but now the package implements lazy locks. When you work with the wallet API, your wallet is blocked until the commit/rollback operation.

The most important change is the check for the start of a transaction has been removed. Inside the package, I completely abandoned the custom solution for creating transactions.

Do not forget about the internal state, it is available exclusively in the AtomicServiceInterface. Those, the introduction of lazy locks does not negate the benefits of atomics. You can read more here: #562

@rez1dent3 rez1dent3 self-assigned this Oct 15, 2022
@cloudflare-pages
Copy link

cloudflare-pages bot commented Oct 15, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 96ed176
Status: ✅  Deploy successful!
Preview URL: https://26154ae0.laravel-wallet.pages.dev
Branch Preview URL: https://event-architecture.laravel-wallet.pages.dev

View logs

@codecov
Copy link

codecov bot commented Oct 15, 2022

Codecov Report

Merging #589 (96ed176) into master (c9401d9) will not change coverage.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##              master      #589   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       511       528   +17     
===========================================
  Files             77        83    +6     
  Lines           1576      1606   +30     
===========================================
+ Hits            1576      1606   +30     
Impacted Files Coverage Δ
...ternal/Exceptions/TransactionRollbackException.php 100.00% <100.00%> (ø)
...nternal/Listeners/TransactionBeginningListener.php 100.00% <100.00%> (ø)
...nternal/Listeners/TransactionCommittedListener.php 100.00% <100.00%> (ø)
...ternal/Listeners/TransactionCommittingListener.php 100.00% <100.00%> (ø)
...ternal/Listeners/TransactionRolledBackListener.php 100.00% <100.00%> (ø)
src/Internal/Repository/WalletRepository.php 100.00% <100.00%> (ø)
src/Internal/Service/ConnectionService.php 100.00% <100.00%> (ø)
src/Internal/Service/DatabaseService.php 100.00% <100.00%> (ø)
src/Internal/Service/LockService.php 100.00% <100.00%> (ø)
src/Services/RegulatorService.php 100.00% <100.00%> (ø)
... and 2 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rez1dent3 rez1dent3 marked this pull request as draft October 16, 2022 06:10
@rez1dent3
Copy link
Member Author

The implementation is blocked by the framework. The committing event is missing.

@rez1dent3 rez1dent3 marked this pull request as ready for review October 19, 2022 15:33
@rez1dent3
Copy link
Member Author

The lock is released, the event has appeared in the framework. PR needs to be improved.

@rez1dent3
Copy link
Member Author

rez1dent3 commented Oct 26, 2022

At the moment, there are big problems with laravel octane support. While the release is delayed.

I will have to pull classes in events from app(). The octane issue will most likely go away.

@rez1dent3 rez1dent3 merged commit e047a9b into master Oct 27, 2022
@rez1dent3 rez1dent3 deleted the event-architecture branch October 30, 2022 19:17
@rez1dent3 rez1dent3 mentioned this pull request Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing tests bug: DB::rollBack(0) in nova action prevents actionable trait to works
1 participant