-
Notifications
You must be signed in to change notification settings - Fork 61
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
Event Loop & Socket Type Multi-Support #692
Open
xiazhvera
wants to merge
55
commits into
main
Choose a base branch
from
runtime_select_event_loop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
9d97302
Checkpoint
bretambrose 9781845
Updated with doc comments
754c56d
Creation API
974a9b2
Checkpoint
0b7b061
Merge branch 'main' into EventLoopPublicApi
75e4f45
Formatting
4a784cc
Oops
381f3dd
Windows updates
e63c0a8
test update
09cff00
[WIP] API update for runtime switch event loop
xiazhvera ca3a134
update event loop group creation
xiazhvera 6619695
clang format
xiazhvera 7a89d9e
revert shutdown_types?
xiazhvera 56fa4d1
rename cmake flags
xiazhvera c1a4971
fix default event loop
xiazhvera 470164b
improve error message
xiazhvera 9e6d574
Update based on PR feedback:
d8f5fdd
Merge branch 'EventLoopPublicApi' of github.com:awslabs/aws-c-io into…
xiazhvera 9323cc3
Make io testing channel usable across library boundaries
b771d8c
Revert "Make io testing channel usable across library boundaries"
4f3048e
add function to override the default event loop type
xiazhvera fcb3d9a
Revert "Revert "Make io testing channel usable across library boundar…
9b16a3b
Set allocator
a30cd39
default event loop type override
xiazhvera 74733ad
hide the test help function as internal private
xiazhvera 558d179
clang format
xiazhvera 16d4e25
remove unreachable..
xiazhvera 7cb0936
update cmake for dispatch queue
xiazhvera e84a1a6
introduce socket vtable
xiazhvera d79b5b7
fix platform error code
xiazhvera 3ce216c
remove global vtable
xiazhvera 6233c9d
fix flag
xiazhvera 0f75185
set apple networkframework flag
xiazhvera f7fb5a2
prevent fail fast
xiazhvera 16861b9
update cmake event loop defines
xiazhvera 17c7cca
temporary remove dispatch queue wrap
xiazhvera d68acdb
Doc comments
bretambrose 3999196
make apple network framework public
xiazhvera 6f1984c
Merge branch 'EventLoopPublicApi' of github.com:awslabs/aws-c-io into…
xiazhvera 8d84d11
Apply suggestions from code review
xiazhvera 71fae6f
update cr changes
xiazhvera 35efc2e
Merge branch 'runtime_select_event_loop' of github.com:awslabs/aws-c-…
xiazhvera 405c988
rename enum
xiazhvera e614bdc
Merge branch 'main' of github.com:awslabs/aws-c-io into runtime_selec…
xiazhvera e22131a
Merge branch 'main' into runtime_select_event_loop
xiazhvera 51e2d5a
eliminate event loop constructor
xiazhvera 8be6cd2
clean up and format
xiazhvera ab05a35
Merge branch 'main' into runtime_select_event_loop
xiazhvera 61cbc90
lint
xiazhvera 4d0e12c
Merge branch 'runtime_select_event_loop' of github.com:awslabs/aws-c-…
xiazhvera 7b51b56
wrap the kqueue function
xiazhvera aa876a1
add posix file for non-darwin Apple platform
xiazhvera ee7fa76
fix lint
xiazhvera 2fb32ab
handling library error in cmake
xiazhvera f5a5338
Merge branch 'main' into runtime_select_event_loop
xiazhvera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,8 +90,27 @@ struct aws_event_loop_local_object { | |
struct aws_event_loop_options { | ||
aws_io_clock_fn *clock; | ||
struct aws_thread_options *thread_options; | ||
|
||
/** | ||
* Event loop type. If the event loop type is set to AWS_EVENT_LOOP_PLATFORM_DEFAULT, the | ||
* creation function will automatically use the platform’s default event loop type. | ||
*/ | ||
enum aws_event_loop_type type; | ||
}; | ||
|
||
struct aws_event_loop *aws_event_loop_new_iocp_with_options( | ||
struct aws_allocator *alloc, | ||
const struct aws_event_loop_options *options); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's put an empty line between function decls. Also I'd drop the 'with_options'. That's not saying anything useful. I'd use 'with_<event_loop_type>' instead (with_dispatch_queue, with_kqueue, etc...) |
||
struct aws_event_loop *aws_event_loop_new_dispatch_queue_with_options( | ||
struct aws_allocator *alloc, | ||
const struct aws_event_loop_options *options); | ||
struct aws_event_loop *aws_event_loop_new_kqueue_with_options( | ||
struct aws_allocator *alloc, | ||
const struct aws_event_loop_options *options); | ||
struct aws_event_loop *aws_event_loop_new_epoll_with_options( | ||
struct aws_allocator *alloc, | ||
const struct aws_event_loop_options *options); | ||
|
||
typedef struct aws_event_loop *(aws_new_event_loop_fn)(struct aws_allocator *alloc, | ||
const struct aws_event_loop_options *options, | ||
void *new_loop_user_data); | ||
|
@@ -105,7 +124,7 @@ struct aws_event_loop_group { | |
|
||
AWS_EXTERN_C_BEGIN | ||
|
||
#ifdef AWS_USE_IO_COMPLETION_PORTS | ||
#ifdef AWS_ENABLE_IO_COMPLETION_PORTS | ||
|
||
/** | ||
* Prepares aws_overlapped for use, and sets a function to call when the overlapped operation completes. | ||
|
@@ -128,6 +147,7 @@ void aws_overlapped_reset(struct aws_overlapped *overlapped); | |
*/ | ||
AWS_IO_API | ||
struct _OVERLAPPED *aws_overlapped_to_windows_overlapped(struct aws_overlapped *overlapped); | ||
#endif /* AWS_ENABLE_IO_COMPLETION_PORTS */ | ||
|
||
/** | ||
* Associates an aws_io_handle with the event loop's I/O Completion Port. | ||
|
@@ -144,8 +164,6 @@ int aws_event_loop_connect_handle_to_io_completion_port( | |
struct aws_event_loop *event_loop, | ||
struct aws_io_handle *handle); | ||
|
||
#else | ||
|
||
/** | ||
* Subscribes on_event to events on the event-loop for handle. events is a bitwise concatenation of the events that were | ||
* received. The definition for these values can be found in aws_io_event_type. Currently, only | ||
|
@@ -161,8 +179,6 @@ int aws_event_loop_subscribe_to_io_events( | |
aws_event_loop_on_event_fn *on_event, | ||
void *user_data); | ||
|
||
#endif /* AWS_USE_IO_COMPLETION_PORTS */ | ||
|
||
/** | ||
* Creates an instance of the default event loop implementation for the current architecture and operating system. | ||
*/ | ||
|
@@ -174,9 +190,7 @@ struct aws_event_loop *aws_event_loop_new_default(struct aws_allocator *alloc, a | |
* extendable options. | ||
*/ | ||
AWS_IO_API | ||
struct aws_event_loop *aws_event_loop_new_default_with_options( | ||
struct aws_allocator *alloc, | ||
const struct aws_event_loop_options *options); | ||
struct aws_event_loop *aws_event_loop_new(struct aws_allocator *alloc, const struct aws_event_loop_options *options); | ||
|
||
/** | ||
* Initializes common event-loop data structures. | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Table isn't very well aligned