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

Track lease usage in the schema #1407

Open
alecthomas opened this issue May 4, 2024 · 0 comments
Open

Track lease usage in the schema #1407

alecthomas opened this issue May 4, 2024 · 0 comments
Labels
intermediate A task requiring an intermediate level of knowledge

Comments

@alecthomas
Copy link
Collaborator

Similar to how we track verb-to-verb calls, we should add metadata for lease usage:

verb myVerb(Empty) Empty
  +leases user/update

Currently lease keys are completely dynamic, so we might need to introduce some sort of registration/handle system as we do for other resources, eg.

var userUpdateLease = ftl.Lease("user", "update")

//ftl:verb
func MyVerb(ctx context.Context, user User) error {
  lease, err := userUpdateLease.Acquire(ctx, user.Id)
  if err != nil {
    return err
  }
  defer lease.Release()
  // ...
}

Not sure.

@alecthomas alecthomas added the intermediate A task requiring an intermediate level of knowledge label May 4, 2024
@github-actions github-actions bot added the triage Issue needs triaging label May 4, 2024
@alecthomas alecthomas mentioned this issue May 4, 2024
@alecthomas alecthomas removed the triage Issue needs triaging label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intermediate A task requiring an intermediate level of knowledge
Projects
None yet
Development

No branches or pull requests

1 participant