Skip to content

Conversation

@Skepfyr
Copy link

@Skepfyr Skepfyr commented Jan 29, 2022

This is a quick example of what a token implementation might look like. It was mostly mechanical however the most interesting changes where to BoxService, and all the middlewares that have more than one backing service (I gave up entirely with balance as it's current structure just doesn't work with this form of Token).

The most interesting takeaway I had is that currently you can only get one "Token" at a time per Service instance, which means that services can store readiness state in the service itself; with a Token you have to store readiness in the token as you can give out more than one at a time. That forces tokens to allocate if the number of backing services isn't known at compile time.

@hawkw hawkw mentioned this pull request Feb 2, 2022
2 tasks
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.

1 participant