-
Notifications
You must be signed in to change notification settings - Fork 227
feat: speed up ServiceBrowsers with a cython pxd #1270
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
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
|
|
||
| import cython | ||
|
|
||
| from .._cache cimport DNSCache | ||
| from .._protocol.outgoing cimport DNSOutgoing, DNSPointer, DNSQuestion, DNSRecord | ||
| from .._updates cimport RecordUpdateListener | ||
| from .._utils.time cimport current_time_millis, millis_to_seconds | ||
|
|
||
|
|
||
| cdef object TYPE_CHECKING | ||
| cdef object cached_possible_types | ||
| cdef cython.uint _EXPIRE_REFRESH_TIME_PERCENT | ||
| cdef object SERVICE_STATE_CHANGE_ADDED, SERVICE_STATE_CHANGE_REMOVED, SERVICE_STATE_CHANGE_UPDATED | ||
|
|
||
| cdef class _DNSPointerOutgoingBucket: | ||
|
|
||
| cdef public object now | ||
| cdef public DNSOutgoing out | ||
| cdef public cython.uint bytes | ||
|
|
||
| cpdef add(self, cython.uint max_compressed_size, DNSQuestion question, cython.set answers) | ||
|
|
||
|
|
||
| @cython.locals(answer=DNSPointer) | ||
| cdef _group_ptr_queries_with_known_answers(object now, object multicast, cython.dict question_with_known_answers) | ||
|
|
||
| cdef class QueryScheduler: | ||
|
|
||
| cdef cython.set _types | ||
| cdef cython.dict _next_time | ||
| cdef object _first_random_delay_interval | ||
| cdef cython.dict _delay | ||
|
|
||
| cpdef millis_to_wait(self, object now) | ||
|
|
||
| cpdef reschedule_type(self, object type_, object next_time) | ||
|
|
||
| cpdef process_ready_types(self, object now) | ||
|
|
||
| cdef class _ServiceBrowserBase(RecordUpdateListener): | ||
|
|
||
| cdef public cython.set types | ||
| cdef public object zc | ||
| cdef object _loop | ||
| cdef public object addr | ||
| cdef public object port | ||
| cdef public object multicast | ||
| cdef public object question_type | ||
| cdef public cython.dict _pending_handlers | ||
| cdef public object _service_state_changed | ||
| cdef public QueryScheduler query_scheduler | ||
| cdef public bint done | ||
| cdef public object _first_request | ||
| cdef public object _next_send_timer | ||
| cdef public object _query_sender_task | ||
|
|
||
| cpdef _generate_ready_queries(self, object first_request, object now) | ||
|
|
||
| cpdef _enqueue_callback(self, object state_change, object type_, object name) | ||
|
|
||
| @cython.locals(record=DNSRecord, cache=DNSCache, service=DNSRecord) | ||
| cpdef async_update_records(self, object zc, cython.float now, cython.list records) | ||
|
|
||
| cpdef _names_matching_types(self, object types) | ||
|
|
||
| cpdef reschedule_type(self, object type_, object now, object next_time) | ||
|
|
||
| cpdef _fire_service_state_changed_event(self, cython.tuple event) | ||
|
|
||
| cpdef _async_send_ready_queries_schedule_next(self) | ||
|
|
||
| cpdef _async_schedule_next(self, object now) | ||
|
|
||
| cpdef _async_send_ready_queries(self, object now) |
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.