Packages
mist
1.2.0
6.0.3
6.0.2
6.0.1
6.0.0
5.0.4
5.0.3
5.0.2
5.0.1
5.0.0
5.0.0-rc1
4.0.7
4.0.6
4.0.5
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
3.0.0
2.0.0
1.2.0
1.1.0
1.0.0
1.0.0-rc3
1.0.0-rc2
1.0.0-rc1
0.17.0
0.15.0
0.14.3
0.14.2
0.14.1
0.14.0
0.13.2
0.13.1
0.13.0
0.12.0
0.11.0
0.10.0
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.8.0
0.7.1
0.7.0
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.3
a misty Gleam web server
Current section
67 Versions
Jump to
Current section
67 Versions
Compare versions
10
files changed
+95
additions
-207
deletions
| @@ -1,11 +1,14 @@ | |
| 1 1 | name = "mist" |
| 2 | - version = "1.1.0" |
| 2 | + version = "1.2.0" |
| 3 3 | |
| 4 4 | licences = ["Apache-2.0"] |
| 5 5 | description = "a misty Gleam web server" |
| 6 6 | repository = { type = "github", user = "rawhat", repo = "mist" } |
| 7 7 | target = "erlang" |
| 8 | - gleam = ">= 1.0.0" |
| 8 | + gleam = ">= 1.2.0" |
| 9 | + |
| 10 | + [erlang] |
| 11 | + application_start_module = "mist@internal@clock" |
| 9 12 | |
| 10 13 | [dependencies] |
| 11 14 | birl = "~> 1.3" |
| @@ -1,32 +1,32 @@ | |
| 1 1 | {<<"name">>, <<"mist">>}. |
| 2 2 | {<<"app">>, <<"mist">>}. |
| 3 | - {<<"version">>, <<"1.1.0">>}. |
| 4 | - {<<"description">>, <<"a misty Gleam web server">>}. |
| 3 | + {<<"version">>, <<"1.2.0">>}. |
| 4 | + {<<"description">>, <<"a misty Gleam web server"/utf8>>}. |
| 5 5 | {<<"licenses">>, [<<"Apache-2.0">>]}. |
| 6 6 | {<<"build_tools">>, [<<"gleam">>]}. |
| 7 7 | {<<"links">>, [ |
| 8 8 | {<<"Repository">>, <<"https://github.com/rawhat/mist">>} |
| 9 9 | ]}. |
| 10 10 | {<<"requirements">>, [ |
| 11 | - {<<"gleam_erlang">>, [ |
| 12 | - {<<"app">>, <<"gleam_erlang">>}, |
| 11 | + {<<"glisten">>, [ |
| 12 | + {<<"app">>, <<"glisten">>}, |
| 13 13 | {<<"optional">>, false}, |
| 14 | - {<<"requirement">>, <<"~> 0.24">>} |
| 14 | + {<<"requirement">>, <<"~> 2.0">>} |
| 15 | + ]}, |
| 16 | + {<<"gleam_http">>, [ |
| 17 | + {<<"app">>, <<"gleam_http">>}, |
| 18 | + {<<"optional">>, false}, |
| 19 | + {<<"requirement">>, <<"~> 3.5">>} |
| 15 20 | ]}, |
| 16 21 | {<<"gleam_stdlib">>, [ |
| 17 22 | {<<"app">>, <<"gleam_stdlib">>}, |
| 18 23 | {<<"optional">>, false}, |
| 19 24 | {<<"requirement">>, <<"~> 0.35 or ~> 1.0">>} |
| 20 25 | ]}, |
| 21 | - {<<"hpack_erl">>, [ |
| 22 | - {<<"app">>, <<"hpack_erl">>}, |
| 26 | + {<<"gleam_erlang">>, [ |
| 27 | + {<<"app">>, <<"gleam_erlang">>}, |
| 23 28 | {<<"optional">>, false}, |
| 24 | - {<<"requirement">>, <<"~> 0.3">>} |
| 25 | - ]}, |
| 26 | - {<<"glisten">>, [ |
| 27 | - {<<"app">>, <<"glisten">>}, |
| 28 | - {<<"optional">>, false}, |
| 29 | - {<<"requirement">>, <<"~> 2.0">>} |
| 29 | + {<<"requirement">>, <<"~> 0.24">>} |
| 30 30 | ]}, |
| 31 31 | {<<"logging">>, [ |
| 32 32 | {<<"app">>, <<"logging">>}, |
| @@ -38,20 +38,20 @@ | |
| 38 38 | {<<"optional">>, false}, |
| 39 39 | {<<"requirement">>, <<"~> 2.0">>} |
| 40 40 | ]}, |
| 41 | - {<<"birl">>, [ |
| 42 | - {<<"app">>, <<"birl">>}, |
| 41 | + {<<"hpack_erl">>, [ |
| 42 | + {<<"app">>, <<"hpack_erl">>}, |
| 43 43 | {<<"optional">>, false}, |
| 44 | - {<<"requirement">>, <<"~> 1.3">>} |
| 45 | - ]}, |
| 46 | - {<<"gleam_http">>, [ |
| 47 | - {<<"app">>, <<"gleam_http">>}, |
| 48 | - {<<"optional">>, false}, |
| 49 | - {<<"requirement">>, <<"~> 3.5">>} |
| 44 | + {<<"requirement">>, <<"~> 0.3">>} |
| 50 45 | ]}, |
| 51 46 | {<<"gleam_otp">>, [ |
| 52 47 | {<<"app">>, <<"gleam_otp">>}, |
| 53 48 | {<<"optional">>, false}, |
| 54 49 | {<<"requirement">>, <<"~> 0.9">>} |
| 50 | + ]}, |
| 51 | + {<<"birl">>, [ |
| 52 | + {<<"app">>, <<"birl">>}, |
| 53 | + {<<"optional">>, false}, |
| 54 | + {<<"requirement">>, <<"~> 1.3">>} |
| 55 55 | ]} |
| 56 56 | ]}. |
| 57 57 | {<<"files">>, [ |
| @@ -1,5 +1,6 @@ | |
| 1 1 | {application, mist, [ |
| 2 | - {vsn, "1.1.0"}, |
| 2 | + {mod, {'mist@internal@clock', []}}, |
| 3 | + {vsn, "1.2.0"}, |
| 3 4 | {applications, [birl, |
| 4 5 | gleam_erlang, |
| 5 6 | gleam_hackney, |
| @@ -26,9 +26,9 @@ | |
| 26 26 | mist@internal@buffer:buffer(), |
| 27 27 | boolean()}. |
| 28 28 | |
| 29 | - -opaque builder(OHA, OHB) :: {builder, |
| 29 | + -opaque builder(OHH, OHI) :: {builder, |
| 30 30 | integer(), |
| 31 | - fun((gleam@http@request:request(OHA)) -> gleam@http@response:response(OHB)), |
| 31 | + fun((gleam@http@request:request(OHH)) -> gleam@http@response:response(OHI)), |
| 32 32 | fun((integer(), gleam@http:scheme()) -> nil)}. |
| 33 33 | |
| 34 34 | -type certificate_error() :: no_certificate | no_key | no_key_or_certificate. |
| @@ -36,11 +36,11 @@ | |
| 36 36 | -type https_error() :: {glisten_error, glisten:start_error()} | |
| 37 37 | {certificate_error, certificate_error()}. |
| 38 38 | |
| 39 | - -type websocket_message(OHC) :: {text, binary()} | |
| 39 | + -type websocket_message(OHJ) :: {text, binary()} | |
| 40 40 | {binary, bitstring()} | |
| 41 41 | closed | |
| 42 42 | shutdown | |
| 43 | - {custom, OHC}. |
| 43 | + {custom, OHJ}. |
| 44 44 | |
| 45 45 | -opaque sse_connection() :: {sse_connection, mist@internal@http:connection()}. |
| 46 46 | |
| @@ -302,7 +302,7 @@ stream(Req) -> | |
| 302 302 | value => _assert_fail, |
| 303 303 | module => <<"mist"/utf8>>, |
| 304 304 | function => <<"stream"/utf8>>, |
| 305 | - line => 276}) |
| 305 | + line => 275}) |
| 306 306 | end, |
| 307 307 | case Is_chunked of |
| 308 308 | true -> |
| @@ -335,8 +335,8 @@ stream(Req) -> | |
| 335 335 | ). |
| 336 336 | |
| 337 337 | -spec new( |
| 338 | - fun((gleam@http@request:request(OHX)) -> gleam@http@response:response(OHZ)) |
| 339 | - ) -> builder(OHX, OHZ). |
| 338 | + fun((gleam@http@request:request(OIE)) -> gleam@http@response:response(OIG)) |
| 339 | + ) -> builder(OIE, OIG). |
| 340 340 | new(Handler) -> |
| 341 341 | {builder, |
| 342 342 | 4000, |
| @@ -349,15 +349,15 @@ new(Handler) -> | |
| 349 349 | gleam@io:println(Message) |
| 350 350 | end}. |
| 351 351 | |
| 352 | - -spec port(builder(OID, OIE), integer()) -> builder(OID, OIE). |
| 352 | + -spec port(builder(OIK, OIL), integer()) -> builder(OIK, OIL). |
| 353 353 | port(Builder, Port) -> |
| 354 354 | erlang:setelement(2, Builder, Port). |
| 355 355 | |
| 356 356 | -spec read_request_body( |
| 357 | - builder(bitstring(), OIJ), |
| 357 | + builder(bitstring(), OIQ), |
| 358 358 | integer(), |
| 359 | - gleam@http@response:response(OIJ) |
| 360 | - ) -> builder(mist@internal@http:connection(), OIJ). |
| 359 | + gleam@http@response:response(OIQ) |
| 360 | + ) -> builder(mist@internal@http:connection(), OIQ). |
| 361 361 | read_request_body(Builder, Bytes_limit, Failure_response) -> |
| 362 362 | Handler = fun(Request) -> case read_body(Request, Bytes_limit) of |
| 363 363 | {ok, Request@1} -> |
| @@ -369,9 +369,9 @@ read_request_body(Builder, Bytes_limit, Failure_response) -> | |
| 369 369 | {builder, erlang:element(2, Builder), Handler, erlang:element(4, Builder)}. |
| 370 370 | |
| 371 371 | -spec after_start( |
| 372 | - builder(OIP, OIQ), |
| 372 | + builder(OIW, OIX), |
| 373 373 | fun((integer(), gleam@http:scheme()) -> nil) |
| 374 | - ) -> builder(OIP, OIQ). |
| 374 | + ) -> builder(OIW, OIX). |
| 375 375 | after_start(Builder, After_start) -> |
| 376 376 | erlang:setelement(4, Builder, After_start). |
| 377 377 | |
| @@ -395,72 +395,23 @@ convert_body_types(Resp) -> | |
| 395 395 | end, |
| 396 396 | gleam@http@response:set_body(Resp, New_body). |
| 397 397 | |
| 398 | - -spec convert_glisten_error(glisten:start_error()) -> gleam@otp@actor:start_error(). |
| 399 | - convert_glisten_error(Err) -> |
| 400 | - case Err of |
| 401 | - acceptor_timeout -> |
| 402 | - init_timeout; |
| 403 | - |
| 404 | - {acceptor_failed, Reason} -> |
| 405 | - {init_failed, Reason}; |
| 406 | - |
| 407 | - {acceptor_crashed, Reason@1} -> |
| 408 | - {init_crashed, Reason@1}; |
| 409 | - |
| 410 | - listener_closed -> |
| 411 | - {init_failed, {abnormal, <<"Listener socket closed"/utf8>>}}; |
| 412 | - |
| 413 | - listener_timeout -> |
| 414 | - {init_failed, {abnormal, <<"Listener startup timed out"/utf8>>}}; |
| 415 | - |
| 416 | - {system_error, Reason@2} -> |
| 417 | - {init_failed, |
| 418 | - {abnormal, |
| 419 | - <<"Socket error: "/utf8, |
| 420 | - (gleam@string:inspect(Reason@2))/binary>>}} |
| 421 | - end. |
| 422 | - |
| 423 398 | -spec start_http(builder(mist@internal@http:connection(), response_data())) -> {ok, |
| 424 399 | gleam@erlang@process:subject(gleam@otp@supervisor:message())} | |
| 425 400 | {error, glisten:start_error()}. |
| 426 401 | start_http(Builder) -> |
| 427 | - Clock = gleam@otp@supervisor:worker( |
| 428 | - fun(_) -> mist@internal@clock:start() end |
| 429 | - ), |
| 430 | - Glisten_pool = gleam@otp@supervisor:supervisor( |
| 431 | - fun(_) -> |
| 432 402 | _pipe = fun(Req) -> |
| 433 403 | convert_body_types((erlang:element(3, Builder))(Req)) |
| 434 404 | end, |
| 435 405 | _pipe@1 = mist@internal@handler:with_func(_pipe), |
| 436 406 | _pipe@2 = glisten:handler(fun mist@internal@handler:init/1, _pipe@1), |
| 437 407 | _pipe@3 = glisten:serve(_pipe@2, erlang:element(2, Builder)), |
| 438 | - _pipe@4 = gleam@result:map( |
| 408 | + gleam@result:map( |
| 439 409 | _pipe@3, |
| 440 410 | fun(Subj) -> |
| 441 | - (erlang:element(4, Builder))( |
| 442 | - erlang:element(2, Builder), |
| 443 | - http |
| 444 | - ), |
| 411 | + (erlang:element(4, Builder))(erlang:element(2, Builder), http), |
| 445 412 | Subj |
| 446 413 | end |
| 447 | - ), |
| 448 | - gleam@result:map_error(_pipe@4, fun convert_glisten_error/1) |
| 449 | - end |
| 450 | - ), |
| 451 | - _pipe@7 = gleam@otp@supervisor:start(fun(Children) -> _pipe@5 = Children, |
| 452 | - _pipe@6 = gleam@otp@supervisor:add(_pipe@5, Clock), |
| 453 | - gleam@otp@supervisor:add(_pipe@6, Glisten_pool) end), |
| 454 | - gleam@result:map_error(_pipe@7, fun(Err) -> case Err of |
| 455 | - init_timeout -> |
| 456 | - acceptor_timeout; |
| 457 | - |
| 458 | - {init_failed, Reason} -> |
| 459 | - {acceptor_failed, Reason}; |
| 460 | - |
| 461 | - {init_crashed, Reason@1} -> |
| 462 | - {acceptor_crashed, Reason@1} |
| 463 | - end end). |
| 414 | + ). |
| 464 415 | |
| 465 416 | -spec start_https( |
| 466 417 | builder(mist@internal@http:connection(), response_data()), |
| @@ -486,20 +437,12 @@ start_https(Builder, Certfile, Keyfile) -> | |
| 486 437 | end, |
| 487 438 | gleam@result:then( |
| 488 439 | Res, |
| 489 | - fun(_) -> |
| 490 | - Clock = gleam@otp@supervisor:worker( |
| 491 | - fun(_) -> mist@internal@clock:start() end |
| 492 | - ), |
| 493 | - Glisten_pool = gleam@otp@supervisor:supervisor( |
| 494 440 | fun(_) -> |
| 495 441 | _pipe = fun(Req) -> |
| 496 442 | convert_body_types((erlang:element(3, Builder))(Req)) |
| 497 443 | end, |
| 498 444 | _pipe@1 = mist@internal@handler:with_func(_pipe), |
| 499 | - _pipe@2 = glisten:handler( |
| 500 | - fun mist@internal@handler:init/1, |
| 501 | - _pipe@1 |
| 502 | - ), |
| 445 | + _pipe@2 = glisten:handler(fun mist@internal@handler:init/1, _pipe@1), |
| 503 446 | _pipe@3 = glisten:serve_ssl( |
| 504 447 | _pipe@2, |
| 505 448 | erlang:element(2, Builder), |
| @@ -516,34 +459,16 @@ start_https(Builder, Certfile, Keyfile) -> | |
| 516 459 | Subj |
| 517 460 | end |
| 518 461 | ), |
| 519 | - gleam@result:map_error(_pipe@4, fun convert_glisten_error/1) |
| 520 | - end |
| 521 | - ), |
| 522 | - _pipe@7 = gleam@otp@supervisor:start( |
| 523 | - fun(Children) -> _pipe@5 = Children, |
| 524 | - _pipe@6 = gleam@otp@supervisor:add(_pipe@5, Clock), |
| 525 | - gleam@otp@supervisor:add(_pipe@6, Glisten_pool) end |
| 526 | - ), |
| 527 | - _pipe@8 = gleam@result:map_error(_pipe@7, fun(Err) -> case Err of |
| 528 | - init_timeout -> |
| 529 | - acceptor_timeout; |
| 530 | - |
| 531 | - {init_failed, Reason} -> |
| 532 | - {acceptor_failed, Reason}; |
| 533 | - |
| 534 | - {init_crashed, Reason@1} -> |
| 535 | - {acceptor_crashed, Reason@1} |
| 536 | - end end), |
| 537 462 | gleam@result:map_error( |
| 538 | - _pipe@8, |
| 463 | + _pipe@4, |
| 539 464 | fun(Field@0) -> {glisten_error, Field@0} end |
| 540 465 | ) |
| 541 466 | end |
| 542 467 | ). |
| 543 468 | |
| 544 469 | -spec internal_to_public_ws_message( |
| 545 | - mist@internal@websocket:handler_message(OJH) |
| 546 | - ) -> {ok, websocket_message(OJH)} | {error, nil}. |
| 470 | + mist@internal@websocket:handler_message(OJO) |
| 471 | + ) -> {ok, websocket_message(OJO)} | {error, nil}. |
| 547 472 | internal_to_public_ws_message(Msg) -> |
| 548 473 | case Msg of |
| 549 474 | {internal, {data, {text_frame, _, Data}}} -> |
| @@ -563,10 +488,10 @@ internal_to_public_ws_message(Msg) -> | |
| 563 488 | |
| 564 489 | -spec websocket( |
| 565 490 | gleam@http@request:request(mist@internal@http:connection()), |
| 566 | - fun((OJN, mist@internal@websocket:websocket_connection(), websocket_message(OJO)) -> gleam@otp@actor:next(OJO, OJN)), |
| 567 | - fun((mist@internal@websocket:websocket_connection()) -> {OJN, |
| 568 | - gleam@option:option(gleam@erlang@process:selector(OJO))}), |
| 569 | - fun((OJN) -> nil) |
| 491 | + fun((OJU, mist@internal@websocket:websocket_connection(), websocket_message(OJV)) -> gleam@otp@actor:next(OJV, OJU)), |
| 492 | + fun((mist@internal@websocket:websocket_connection()) -> {OJU, |
| 493 | + gleam@option:option(gleam@erlang@process:selector(OJV))}), |
| 494 | + fun((OJU) -> nil) |
| 570 495 | ) -> gleam@http@response:response(response_data()). |
| 571 496 | websocket(Request, Handler, On_init, On_close) -> |
| 572 497 | Handler@1 = fun(State, Connection, Message) -> _pipe = Message, |
| @@ -663,7 +588,7 @@ send_binary_frame(Connection, Frame) -> | |
| 663 588 | message => <<"Exiting due to sending WebSocket message from non-owning process"/utf8>>, |
| 664 589 | module => <<"mist"/utf8>>, |
| 665 590 | function => <<"send_binary_frame"/utf8>>, |
| 666 | - line => 583}) |
| 591 | + line => 530}) |
| 667 592 | end. |
| 668 593 | |
| 669 594 | -spec send_text_frame(mist@internal@websocket:websocket_connection(), binary()) -> {ok, |
| @@ -697,7 +622,7 @@ send_text_frame(Connection, Frame) -> | |
| 697 622 | message => <<"Exiting due to sending WebSocket message from non-owning process"/utf8>>, |
| 698 623 | module => <<"mist"/utf8>>, |
| 699 624 | function => <<"send_text_frame"/utf8>>, |
| 700 | - line => 607}) |
| 625 | + line => 554}) |
| 701 626 | end. |
| 702 627 | |
| 703 628 | -spec event(gleam@string_builder:string_builder()) -> sse_event(). |
| @@ -715,8 +640,8 @@ event_name(Event, Name) -> | |
| 715 640 | -spec server_sent_events( |
| 716 641 | gleam@http@request:request(mist@internal@http:connection()), |
| 717 642 | gleam@http@response:response(any()), |
| 718 | - fun(() -> gleam@otp@actor:init_result(OKC, OKD)), |
| 719 | - fun((OKD, sse_connection(), OKC) -> gleam@otp@actor:next(OKD, OKC)) |
| 643 | + fun(() -> gleam@otp@actor:init_result(OKJ, OKK)), |
| 644 | + fun((OKK, sse_connection(), OKJ) -> gleam@otp@actor:next(OKK, OKJ)) |
| 720 645 | ) -> gleam@http@response:response(response_data()). |
| 721 646 | server_sent_events(Req, Resp, Init, Loop) -> |
| 722 647 | With_default_headers = begin |
| @@ -21,7 +21,6 @@ import glisten/transport | |
| 21 21 | import gramps/websocket.{BinaryFrame, Data, TextFrame} as gramps_websocket |
| 22 22 | import logging |
| 23 23 | import mist/internal/buffer.{type Buffer, Buffer} |
| 24 | - import mist/internal/clock |
| 25 24 | import mist/internal/encoder |
| 26 25 | import mist/internal/file |
| 27 26 | import mist/internal/handler |
| @@ -362,29 +361,10 @@ fn convert_body_types( | |
| 362 361 | response.set_body(resp, new_body) |
| 363 362 | } |
| 364 363 | |
| 365 | - fn convert_glisten_error(err: glisten.StartError) -> actor.StartError { |
| 366 | - case err { |
| 367 | - glisten.AcceptorTimeout -> actor.InitTimeout |
| 368 | - glisten.AcceptorFailed(reason) -> actor.InitFailed(reason) |
| 369 | - glisten.AcceptorCrashed(reason) -> actor.InitCrashed(reason) |
| 370 | - glisten.ListenerClosed -> |
| 371 | - actor.InitFailed(process.Abnormal("Listener socket closed")) |
| 372 | - glisten.ListenerTimeout -> |
| 373 | - actor.InitFailed(process.Abnormal("Listener startup timed out")) |
| 374 | - glisten.SystemError(reason) -> |
| 375 | - actor.InitFailed(process.Abnormal( |
| 376 | - "Socket error: " <> string.inspect(reason), |
| 377 | - )) |
| 378 | - } |
| 379 | - } |
| 380 | - |
| 381 364 | /// Start a `mist` service over HTTP with the provided builder. |
| 382 365 | pub fn start_http( |
| 383 366 | builder: Builder(Connection, ResponseData), |
| 384 367 | ) -> Result(Subject(supervisor.Message), glisten.StartError) { |
| 385 | - let clock = supervisor.worker(fn(_argument) { clock.start() }) |
| 386 | - let glisten_pool = |
| 387 | - supervisor.supervisor(fn(_argument) { |
| 388 368 | fn(req) { convert_body_types(builder.handler(req)) } |
| 389 369 | |> handler.with_func |
| 390 370 | |> glisten.handler(handler.init, _) |
| @@ -393,21 +373,6 @@ pub fn start_http( | |
| 393 373 | builder.after_start(builder.port, Http) |
| 394 374 | subj |
| 395 375 | }) |
| 396 | - |> result.map_error(convert_glisten_error) |
| 397 | - }) |
| 398 | - |
| 399 | - supervisor.start(fn(children) { |
| 400 | - children |
| 401 | - |> supervisor.add(clock) |
| 402 | - |> supervisor.add(glisten_pool) |
| 403 | - }) |
| 404 | - |> result.map_error(fn(err) { |
| 405 | - case err { |
| 406 | - actor.InitTimeout -> glisten.AcceptorTimeout |
| 407 | - actor.InitFailed(reason) -> glisten.AcceptorFailed(reason) |
| 408 | - actor.InitCrashed(reason) -> glisten.AcceptorCrashed(reason) |
| 409 | - } |
| 410 | - }) |
| 411 376 | } |
| 412 377 | |
| 413 378 | /// These are the types of errors raised by trying to read the certificate and |
| @@ -446,10 +411,6 @@ pub fn start_https( | |
| 446 411 | |
| 447 412 | use _ <- result.then(res) |
| 448 413 | |
| 449 | - let clock = supervisor.worker(fn(_argument) { clock.start() }) |
| 450 | - |
| 451 | - let glisten_pool = |
| 452 | - supervisor.supervisor(fn(_argument) { |
| 453 414 | fn(req) { convert_body_types(builder.handler(req)) } |
| 454 415 | |> handler.with_func |
| 455 416 | |> glisten.handler(handler.init, _) |
| @@ -458,20 +419,6 @@ pub fn start_https( | |
| 458 419 | builder.after_start(builder.port, Https) |
| 459 420 | subj |
| 460 421 | }) |
| 461 | - |> result.map_error(convert_glisten_error) |
| 462 | - }) |
| 463 | - supervisor.start(fn(children) { |
| 464 | - children |
| 465 | - |> supervisor.add(clock) |
| 466 | - |> supervisor.add(glisten_pool) |
| 467 | - }) |
| 468 | - |> result.map_error(fn(err) { |
| 469 | - case err { |
| 470 | - actor.InitTimeout -> glisten.AcceptorTimeout |
| 471 | - actor.InitFailed(reason) -> glisten.AcceptorFailed(reason) |
| 472 | - actor.InitCrashed(reason) -> glisten.AcceptorCrashed(reason) |
| 473 | - } |
| 474 | - }) |
| 475 422 | |> result.map_error(GlistenError) |
| 476 423 | } |
Loading more files…