Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix canillita:start/2 #39

@elbrujohalcon

Description

@elbrujohalcon

One of the coolest things in SumoREST is that when you build an app using it you don't need any supervision tree. All the processes are taken care of by sumo_db, cowboy, ranch, etc…
You have your own app (that you need, at least, to get yourself a release, right?) and what you do in your application modules is this nasty nasty thing:

    -spec start(application:start_type(), noargs) -> {ok, pid()}.
    start(_Type, noargs) -> {ok, self()}.

Because we're not using supervision tree, but we're using the app for relx and start phases.

Tools like erlang performance lab assume that your app is OTP-compliant (as expected) and returning {ok, self()} is not, as noted in erlanglab/erlangpl#29.

We need to find an alternative way of achieving our goals.

@legoscia pointed out that we could just run what we are currently running on canillita:start_phase/2 in canillita.script directly and just get rid of the mod property in canillita.app.src.
Since canillita.script is generated by relx, we would need to let relx know that we do want to do that using appropriate configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions