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

[Feature Request] Async Request support #148

Closed
sahilsharma011 opened this issue Aug 30, 2018 · 6 comments
Closed

[Feature Request] Async Request support #148

sahilsharma011 opened this issue Aug 30, 2018 · 6 comments

Comments

@sahilsharma011
Copy link
Contributor

sahilsharma011 commented Aug 30, 2018

Is there any plan or roadmap for supporting asynchronous workflows using Eloquent models which have been included in PHP SDK for AWS v3
I can also contribute for this feature if you can show me a roadmap

@baopham
Copy link
Owner

baopham commented Aug 30, 2018

Great suggestion! I'd love for it to be on the roadmap.

Do you have a proposal what the API would look like? e.g. are you suggesting we have something like this: $model->saveAsync(), $model->where(...)->getAsync()? I don't think Eloquent has an async syntax.

@sahilsharma011
Copy link
Contributor Author

Yes, I was thinking along the same lines. For example we can create a new function saveAsync in DynamoDbQueryBuilder.php which can make use of putItemAsync instead of putItem and it can return a promise instead of just true/false.

@baopham
Copy link
Owner

baopham commented Sep 1, 2018

Sounds good. Feel free to create a PR. I'll resume working on this next weekend.

@sahilsharma011
Copy link
Contributor Author

sahilsharma011 commented Sep 1, 2018

Okay I have cloned the project and I'll try to work on a PR. Can you guide me a bit through this.
First I am working on a saveAsync method which will call a new saveAsync method in DynamoDbQueryBuilder class and this method will be making use of putItemAsync which comes with aws php sdk. It will return a promise which will be returned back to where the initial save call was made where the user will wait for this promise resolution as per their needs.
Does this sound good?

@baopham
Copy link
Owner

baopham commented Sep 1, 2018

Yep that sounds about right. The flow should be similar to save. You can start with saveAsync first. For tests, you will need to add testSaveAsync in both DynamoDbCompositeModelTest and DynamoDbNonCompositeModelTest.

Thanks for working on this!

@baopham
Copy link
Owner

baopham commented Sep 16, 2018

🎉 #150

@baopham baopham closed this as completed Sep 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants