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

Try out tokens #631

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Try out tokens #631

wants to merge 1 commit into from

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