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

2.0 Refactor #5

Merged
merged 57 commits into from
Apr 23, 2022
Merged

2.0 Refactor #5

merged 57 commits into from
Apr 23, 2022

Conversation

timkelty
Copy link
Contributor

@timkelty timkelty commented Apr 13, 2022

Enough has changed here, that this would have to be 2.0.

Here's a summary:

  • Following the pattern of other Yii drivers like Redis, I separated all the Dynamo-specific stuff to it's own Connection component.
  • AWS_REGION is now automatically used if present
  • keyPrefix has been replaced with formatKey, which will allow more flexibility and is compatible with compound keys
  • Adding a default ttl is now possible via ttlAttribute and ttl.
  • The SDK's Marshaler is used, and is exposed as a property for use.
  • consistentRead is exposed an option (lifted from https://github.com/aws/aws-sdk-php/blob/3d0d24d9dad824ea4344cfc711b9989d92070aac/src/DynamoDb/StandardSessionConnection.php#L9)
  • compound keys are now supported, via partitionKeyAttribute/sortKeyAttribute.
  • Implemented deleteMany/ deleteExpired (Scan/batch). deleteExpired really shouldn't ever need to be used, as you should use Dynamo's TTL setting. DynamoDbSession->allowGc defaults to false.
  • Sessions now work, and will sync their ttl settings with Sesssion::timeout/ini session settings.
  • Implemented the minimum for queue, until we have a better idea of how that is going to work with Craft

Note: this branch is what is currently running on demos via dev-cloud-refactor

@timkelty timkelty changed the title Cloud refactor 2.0 Refactor Apr 13, 2022
Copy link
Contributor

@jasonmccallister jasonmccallister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some comments and the CI needs to pass. Otherwise we are getting really close! 💯 work!

Makefile Show resolved Hide resolved
src/DynamoDbCache.php Show resolved Hide resolved
src/DynamoDbConnection.php Show resolved Hide resolved
src/DynamoDbQueue.php Show resolved Hide resolved
src/DynamoDbQueue.php Show resolved Hide resolved
src/DynamoDbQueue.php Show resolved Hide resolved
src/DynamoDbSession.php Show resolved Hide resolved
src/DynamoDbSession.php Show resolved Hide resolved
src/DynamoDbSession.php Show resolved Hide resolved
Copy link
Contributor Author

@timkelty timkelty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasonmccallister Replied to the last 2 comments, in your court.

CI pipeline is passing now as well.

src/DynamoDbSession.php Show resolved Hide resolved
src/DynamoDbSession.php Show resolved Hide resolved
src/DynamoDbSession.php Show resolved Hide resolved
src/DynamoDbConnection.php Show resolved Hide resolved
@jasonmccallister
Copy link
Contributor

LGTM!

@angrybrad angrybrad merged commit 9ab4ae4 into master Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants