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

Error while calling it from queue #30

Closed
imyuvii opened this issue Mar 14, 2022 · 2 comments
Closed

Error while calling it from queue #30

imyuvii opened this issue Mar 14, 2022 · 2 comments
Assignees
Labels
bug Something isn't working 🎉 resolved 🎉 When issue is resolved

Comments

@imyuvii
Copy link

imyuvii commented Mar 14, 2022

Serialization of 'Closure' is not allowed

We are building a trading bot, so we have are calling CoinbaseFacade from Queue, It throws "Serialization of 'Closure' is not allowed", Not sure how to fix that

image

@imyuvii imyuvii added the bug Something isn't working label Mar 14, 2022
@MockingMagician
Copy link
Owner

Hello @imyuvii

Can you show me the whole example? CoinbaseFacade doesn't need to be serialized, as it contains only static methods, so why serialize an object that can't be parameterized (immutable).

Can you explain your logic and purpose?

@MockingMagician
Copy link
Owner

Hello @imyuvii

I think that in reality, it is coibaseApi that you serialize, indeed it includes closures which are not natively serializable in php. I implemented a fix to work around the problem, the error should not appear anymore in case of serialization. Make sure you update the package in your project.

Anyway, in case of serialization of such an object, and in the context of cryptos, I strongly advise you to encrypt your serialization to reduce the exposure of sensitive data.

A better solution, in my opinion, seems to be to instantiate your object from your queue task. If you provide me with more details of your code, I could guide you in this direction; and if not, linearization should not be a problem anymore.

Kind regards

@MockingMagician MockingMagician added the 🎉 resolved 🎉 When issue is resolved label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🎉 resolved 🎉 When issue is resolved
Projects
None yet
Development

No branches or pull requests

2 participants