Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: optimize the dns cache (#1119)
- Loading branch information
Showing
6 changed files
with
76 additions
and
30 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import cython | ||
from ._dns cimport ( | ||
DNSAddress, | ||
DNSEntry, | ||
DNSHinfo, | ||
DNSPointer, | ||
DNSRecord, | ||
DNSService, | ||
DNSText, | ||
) | ||
|
||
|
||
cdef object _TYPE_PTR | ||
|
||
cdef _remove_key(cython.dict cache, object key, DNSRecord record) | ||
|
||
|
||
cdef class DNSCache: | ||
|
||
cdef public cython.dict cache | ||
cdef public cython.dict service_cache | ||
|
||
cdef _async_add(self, DNSRecord record) | ||
|
||
cdef _async_remove(self, DNSRecord record) | ||
|
||
|
||
cdef _dns_record_matches(DNSRecord record, object key, object type_, object class_) |
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