Skip to content

Transfer {dynamic_repo_module, dynamic_repo} across processes#1

Closed
spacebat wants to merge 1 commit intomainfrom
dynamic-repos-across-processes
Closed

Transfer {dynamic_repo_module, dynamic_repo} across processes#1
spacebat wants to merge 1 commit intomainfrom
dynamic-repos-across-processes

Conversation

@spacebat
Copy link
Copy Markdown
Owner

@spacebat spacebat commented Mar 5, 2024

This allows for the info used in Ecto.Repo.put_dynamic_repo\1 to carry over to the process actually performing the query.

Contributor checklist

  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

This allows for the info used in Ecto.Repo.put_dynamic_repo\1 to carry
over to the process actually performing the query.
@zachdaniel
Copy link
Copy Markdown

This should be doable with a custom tracer as discussed here: https://elixirforum.com/t/using-an-ash-resource-with-a-dynamic-repository/61138/4?u=zachdaniel

@zachdaniel
Copy link
Copy Markdown

Ah, I see the issue is that you don't have the query. Perhaps we can expand the tracer api to get the subject being used to start a new process.

@zachdaniel
Copy link
Copy Markdown

Actually your preparation to set the process context and a custom tracer together should do what you want.

@spacebat
Copy link
Copy Markdown
Owner Author

spacebat commented Mar 6, 2024

Zach was right, the tracer approach worked

@spacebat spacebat closed this Mar 6, 2024
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