Comments (7)
@phuclh I have figured out the issue. A fix is coming soon. However you can do this part...
->finally(function () use ($id) {
$workflow = StoredWorkflow::find($id);
WorkflowStub::fromStoredWorkflow($workflow)->setReady(true);
})
like this instead...
->finally(function () use ($id) {
WorkflowStub::load($id)->setReady(true);
})
And it will be simpler for you.
from laravel-workflow.
Nice, thank you for the simpler solution. Have you had a chance to look at the issue when serialization is broken when using Batch with Workflow? Right now, I have to override the serialize
, and unserialize
methods in DatabaseBatchRepository
class to make it works.
protected function serialize($value): string
{
return Y::serialize($value);
}
protected function unserialize($serialized): mixed
{
return Y::unserialize($serialized);
}
from laravel-workflow.
@phuclh Yes sir, I figured it out. I have a PR coming to fix it in the next release. 🎉
from laravel-workflow.
Hi
Since batch callbacks are serialized and executed at a later time by the Laravel queue, you should not use the $this variable within the callbacks:
->finally(function () { $this->storedWorkflow->toWorkflow()->setReady(true); })
from laravel-workflow.
Hi Since batch callbacks are serialized and executed at a later time by the Laravel queue, you should not use the $this variable within the callbacks:
->finally(function () { $this->storedWorkflow->toWorkflow()->setReady(true); })
Yes, I already used WorkflowStub::fromStoredWorkflow()
to fix that.
However, do you know why the serialization is broken when using Batch with Workflow? Right now, I have to override the serialize
, and unserialize
method in DatabaseBatchRepository to make it works.
protected function serialize($value): string
{
return Y::serialize($value);
}
protected function unserialize($serialized): mixed
{
return Y::unserialize($serialized);
}
from laravel-workflow.
It sounds like you found a workaround. Is this still a blocker for you?
from laravel-workflow.
Great. Thank you so much 👍😊
from laravel-workflow.
Related Issues (20)
- Workflow stuck at waiting status HOT 2
- The attribute [code] either does not exist or was not retrieved for model HOT 6
- Support MongoDB HOT 8
- No publishable resources for tag [migrations]. HOT 1
- Workflows stuck in waiting when running multiple horizon processes HOT 8
- Duplicated query while running jobs HOT 7
- Error("Call to undefined method React\Promise\Promise::valid()") HOT 2
- Call to a member function valid() on null {"exception":"[object] (Error(code: 0) HOT 10
- workflow run on browser HOT 1
- Can we leverage with Rabbit MQ and Kakfa
- Signals not received due to different queue name prefix HOT 4
- Errors in WithoutOverlappingMiddleware HOT 4
- Activity doesn't execute HOT 17
- Workflow loop on fail HOT 7
- Argument #1 ($storedWorkflow) must be of type Workflow\Models\StoredWorkflow, int given HOT 2
- Serialization of models returned from Activities HOT 1
- Default Queue Not Respected HOT 3
- Exception("Activity timed out.") HOT 3
- Querying a workflow DOES advance child's execution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-workflow.