
Here's a simplification of my code: #include I decided to make the scheduler a parameter of the promise type constructor so that whenever a coroutine is created, the promise registers it with the scheduler. The scheduler includes a stack and some other functionality which is required for the coroutines to run properly it doesn't make sense to have a coroutine which doesn't have access to the scheduler. On hex.pm it has around 200 downloads a day.I'm writing an application where coroutines are executed by a scheduler. It just works, it has 57 stars and 4 forks. Json_xema - i have been using from around 2019/2020(i don’t remember exact date). Adoption numbers, popularity and momentum numbers are on a different scale in elixir world. This does not translate to a problem with language, framework or libraries.

in phoenix forum, there are around 30-40 posts with activity in past week.There is NimbleOptions NimbleOptions - NimbleOptions v0.5.0.Įlixir community is small, it does not have the volume/size like other languages: User is another developer working on the project or user who will be using the application? You mention about something about stopping a user from creating a struct with invalid fields. GitHub - hrzndhrn/xema: Xema is a schema validator for Elixir inspired by JSON Schema.GitHub - hrzndhrn/json_xema: A JSON Schema validator.My current understanding is that Ecto is popular for validating DB persisted structs, and there is some momentum around libraries that validate data received from external services. Of course I’m not saying that only Elixir/ Ecto/ Phoenix core teams are doing a great libraries, but the chances to adopt their libraries in most projects are much higher because of support (as above - supported in official generator), respect for their knowledge/skills and a huge communities around them. You can answer yourself … Do you know and use in most projects temple library? I have used it before introducing heex engine. Personally I’m subscribing Phoenix.HTML goes slim Almost all projects already moved or would move to heex pretty soon not because it’s best for everything and there would never be a better solution, but because a Phoenix core team (of course they had a reason for it) would drop support for it in newest releases. Look that old Phoenix templates would be used almost only in unmaintained projects. They convince a leader that it needs to be used.The library features covers app-specific use cases.

Developers for each project would use at most one library which: There is no chance that one library would be used in most projects especially if it would not be needed in simplest cases.

Look that ecto does not have it’s own generators, but support for it is important in phoenix generators. Have a big community (which comes from points 1 and 2, but it may be required by some companies) - especially a big number of users who test every release

Have guides about it everywhere (just like now it’s for phoenix for example)
STRUCT CONSTRUCTOR GENERATOR
I would say that any library to achieve something like that would need to:īe a part of some generator provided by Elixir core team or related ( ecto, phoenix etc.) I am curious if you think domo will keep growing and start to become a library that people use in most projects, or if there is some resistance to introducing a library for logic that most people feel they can implement on their own quickly? Officially there is no support for preventing others to use write struct by hand.
STRUCT CONSTRUCTOR CODE
There is no solution which covers all use cases, but a pure Elixir validation is pretty simple to write, for example with code below: defmodule Example ĭef sample(data) when is_list(data) Enum.reject(&Keyword.has_key?(data, &1))
