gleam-lang / cowboy

🤠 A Gleam HTTP service adapter for the Cowboy web server
Apache License 2.0
67 stars 13 forks source link

Fix cowboy.start #5

Closed lun-4 closed 4 years ago

lpil commented 4 years ago

Hi @lun-4, could you explain the change and the reason for it? Thank you

michallepicki commented 4 years ago

Maybe I'm unnecessarily chiming in but I am guessing @lun-4 saw the supervisors section of the gleam 0.12 announcement and assumed web.start is analogous to cowboy.start

lun-4 commented 4 years ago

@lpil I was attempting to use gleam_cowboy on gleam 0.12.0 but start returning Result(Pid, Dynamic) caused a compile error. Noticed ErlangStartResult exists on gleam_otp, so I used it and bumped dependency versions to account for that on CI.

lpil commented 4 years ago

Ah I see! There is still a problem here in that ErlangStartResult isn't correct, it really should be Result(Pid, Dynamic) and Gleam libraries should return a normal StartResult. Sorry about this problem here, I've not yet updated the other libraries to use gleam_otp v0.1.

I'm going to publish a new version of gleam_otp now, would you like to update this library or shall I?

lun-4 commented 4 years ago

I can do it!

lpil commented 4 years ago

Thank you!

This function may be useful? https://hexdocs.pm/gleam_otp/gleam/otp/supervisor/#wrap_erlang_start_function Depends exactly how its done