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

Static state in SPI could lead to staleness issues #142

Open
ZacSweers opened this issue May 4, 2017 · 5 comments
Open

Static state in SPI could lead to staleness issues #142

ZacSweers opened this issue May 4, 2017 · 5 comments

Comments

@ZacSweers
Copy link
Contributor

ZacSweers commented May 4, 2017

If you have a TypeProcessor that does stateful things, you could run into issues with that state remaining. Not sure if the static approach was intentional, but just mentioning.

@benjamin-bader
Copy link
Collaborator

Very true! I never considered stateful processors.

What do you have in mind?

@benjamin-bader
Copy link
Collaborator

It might be worthwhile to look at alternatives to the simple SPI model we've been using. Internally we've butted up against its limitations in a few ways:

  • not possible to have more than one processor, so the ones we use end up becoming quite complicated
  • the one-type-at-a-time model is nice for streaming, but in practice we often want to look at other generated type definitions at the same time.

Both problems are solvable, of course - just takes some thought beforehand.

@ZacSweers
Copy link
Contributor Author

Selfpromotion, but could look at Crumb :)

@ZacSweers
Copy link
Contributor Author

Also just saw your previous comment - what we do internally is processors are reused across modules (so we have a warm JIT cache. Buck build optimizations and whatnot). So when we invoke the lookup, we just look them up again for the current classpath

@benjamin-bader
Copy link
Collaborator

(testing whether I still have maintainer access by closing an old issue and re-opening it. sorry zac)

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

No branches or pull requests

2 participants