Skip to content

Make Crystal::IOCP::OverlappedOperation abstract#14987

Merged
straight-shoota merged 3 commits intocrystal-lang:masterfrom
HertzDevil:refactor/overlapped-operation-abstract
Sep 9, 2024
Merged

Make Crystal::IOCP::OverlappedOperation abstract#14987
straight-shoota merged 3 commits intocrystal-lang:masterfrom
HertzDevil:refactor/overlapped-operation-abstract

Conversation

@HertzDevil
Copy link
Contributor

This allows different overlapped operations to provide their own closure data, instead of putting everything in one big class, such as in #14979 (comment).

@HertzDevil HertzDevil added topic:stdlib:concurrency kind:refactor platform:windows Windows support based on the MSVC toolchain / Win32 API labels Sep 7, 2024
Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good idea 👍

The duplication of #try_cancel is a bit unfortunate, because the code structure is pretty similar (also similar for DNS from #14979). Maybe we could find a way to abstract this in a meaningful way, but it's fine. It's mostly boilerplate anyway.

I suppose #try_cancel should be declared as an abstract def in OverlappedOperation though.

@straight-shoota straight-shoota added this to the 1.14.0 milestone Sep 7, 2024
@straight-shoota straight-shoota merged commit 849e0d7 into crystal-lang:master Sep 9, 2024
@HertzDevil HertzDevil deleted the refactor/overlapped-operation-abstract branch September 10, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:refactor platform:windows Windows support based on the MSVC toolchain / Win32 API topic:stdlib:concurrency

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants