Skip to content

Buf_write.create: make switch optional#283

Merged
talex5 merged 1 commit intoocaml-multicore:mainfrom
talex5:buf-switch
Aug 16, 2022
Merged

Buf_write.create: make switch optional#283
talex5 merged 1 commit intoocaml-multicore:mainfrom
talex5:buf-switch

Conversation

@talex5
Copy link
Copy Markdown
Collaborator

@talex5 talex5 commented Aug 16, 2022

The switch is useful to ensure that any fibers waiting for a flush are cancelled on error. However, it's not essential, and whatever cancelled the writer will probably cancel the flushing fibers too anyway. This makes it easier to create buffers outside of the eio event loop and is useful when porting existing code from Faraday.

Also, expose the abort function and the Flush_aborted exception, so that callers can clean up manually.

The switch is useful to ensure that any fibers waiting for a flush are
cancelled on error. However, it's not essential, and whatever cancelled
the writer will probably cancel the flushing fibers too anyway. This
makes it easier to create buffers outside of the eio event loop and
is useful when porting existing code from Faraday.

Also, expose the `abort` function and the `Flush_aborted` exception,
so that callers can clean up manually.
@talex5 talex5 merged commit d694384 into ocaml-multicore:main Aug 16, 2022
@talex5 talex5 deleted the buf-switch branch August 16, 2022 09:59
talex5 added a commit to talex5/opam-repository that referenced this pull request Aug 26, 2022
CHANGES:

New features:

- Add `Eio.Condition` (@TheLortex @talex5 ocaml-multicore/eio#277).
  Allows a fiber to wait for some condition to become true.

- Add `Eio.Net.getaddrinfo` and `getnameinfo` (@bikallem @talex5 ocaml-multicore/eio#278 ocaml-multicore/eio#288 ocaml-multicore/eio#291).
  Convert between host names and addresses.

- Add `Eio.Debug` (@talex5 ocaml-multicore/eio#276).
  Currently, this allows overriding the `traceln` function.

- `Buf_write.create`: make switch optional (@talex5 ocaml-multicore/eio#283).
  This makes things easier for people porting code from Faraday.

Bug fixes:

- Allow sharing of libuv poll handles (@patricoferris @talex5 ocaml-multicore/eio#279).
  Luv doesn't allow two callers to watch the same file handle, so we need to handle that in Eio.

Other changes:

- Upgrade to uring 0.4 (@talex5 ocaml-multicore/eio#290).

- Mention `Mutex`, `Semaphore` and `Condition` in the README (@talex5 ocaml-multicore/eio#281).
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

Successfully merging this pull request may close these issues.

1 participant