fireproofsocks
I ran into a problem when working on a new package designed to inspect Ecto schemas: inspecto | Hex
I suppose this is “obvious” in retrospect, but when a module is being compiled and the @moduledoc block is being evaluated, not all of an app’s modules are available. It appears that modules are compiled in a sorted order (alphabetically?). My observation is that if I inspect the output of :code.all_available() inside my @moduledoc, the results are NOT consistent depending on which module I put it in. That is to say, the list of available modules changes as things are compiled (which sounds quite logical).
Are there ways to control the order in which modules are compiled? Or is there something akin to Application.ensure_started/1 that can make a module wait until the other modules are loaded before it attempts to read them? Or is this entirely the wrong approach?
Thanks for any pointers!
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 1- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
gregvaughn
If you
requireorimporta module, it will ensure it compiles before the current module. There’s not much more control beyond that.