Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert failure faraday.ml:377 using Async #63

Open
roddyyaga opened this issue Nov 22, 2020 · 0 comments
Open

assert failure faraday.ml:377 using Async #63

roddyyaga opened this issue Nov 22, 2020 · 0 comments

Comments

@roddyyaga
Copy link

I'm trying to use faraday with Async like so:

open Async

let handle fd =
  let ic = Reader.create fd in
  let writev = Faraday_async.writev_of_fd fd in
  let output_buffer = Faraday.create 16 in
  let write_output x =
    Faraday_async.serialize output_buffer
      ~yield:(fun buffer -> my_serialize_function buffer x |> return)
      ~writev
  in
  Angstrom_async.parse_many parse_function
    (fun parsed -> parsed |> my_processing_function |> write_output)
    ic
  >>| Result.get_ok

let create_server port =
  Tcp.Server.create_sock_inet ~on_handler_error:`Raise
    (Tcp.Where_to_listen.of_port port) (fun _address socket ->
      handle (Socket.fd socket))

but I get this error any time I try to connect:

((monitor.ml.Error "Assert_failure lib/faraday.ml:377:4"
    ("Raised at file \"async/faraday_async.ml\", line 30, characters 6-15"
     "Called from file \"src/deferred1.ml\", line 17, characters 40-45"
     "Called from file \"src/job_queue.ml\", line 167, characters 6-47"
     "Caught by monitor Tcp.Server.create_sock_inet"))

Any idea why this might be happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant