Further refactoring#5
Conversation
YijunXieMS
left a comment
There was a problem hiding this comment.
Appreciate for the refactoring
|
|
||
| super(EventHubConsumer, self).__init__() | ||
| self._on_event_received = kwargs.get("on_event_received") | ||
| self._loop = loop or asyncio.get_event_loop() |
There was a problem hiding this comment.
should we remove this loop?
There was a problem hiding this comment.
No, it's passed in at _create_handler, and event if we remove the executor stuff from uamqp we probably wont refactor out the event loop just yet. So will keep this for now.
| link_properties=self._link_properties, | ||
| properties=self._client._create_properties( # pylint: disable=protected-access | ||
| self._client._config.user_agent), # pylint:disable=protected-access | ||
| properties=create_properties(self._client._config.user_agent), # pylint:disable=protected-access |
There was a problem hiding this comment.
Can we call create_properties only once somewhere else and use the created one here? The properties don't change once created.
There was a problem hiding this comment.
This is a refinement I think we can do later
sdk/eventhub/azure-eventhubs/azure/eventhub/aio/_consumer_async.py
Outdated
Show resolved
Hide resolved
| async def _start_producer(self, partition_id, send_timeout): | ||
| async with self._lock: | ||
| await self._get_partitions() | ||
| if partition_id not in self._partition_ids and partition_id != "-1": |
There was a problem hiding this comment.
If a user passes in anything not None or a valid partition id, we should raise error. "-1" is invalid.
There was a problem hiding this comment.
But this point a None partitionkey has already been replaced by the All_PARTITIONS value, so this check is valid.
* init commit * Remove eventhubclient * Small fix * apply black style format * Draft refactor of the push mode * Start * Remove iterator test * Callback model receive test * Sync eventhub consumer refactor * Improve sync implementation * Async refactor * Verify send result with uamqp ReceiveClient * Start * Remove iterator test * Callback model receive test * Verify send result with uamqp ReceiveClient * api description update * Verify send result with uamqp ReceiveClient * Draft sync single thread * small fix * Fix tests for on_event (single event) * remove test_producer_client.py * Parse offset as byte * improve variable name in producer client * Consumer constructor accept callback method * fix bug in process error * Update _consumers * Update event processor unit test * Add test method for wrong json string * Fix reconnect test * put back delay in async * Invalid partition check * Change async test * revert back to cancel * Change async test * remove iterator on consumer * more remove * Fix a bug of validating wrong partition id * Add async test * async while true * fix async error handling * Catch link stolen and throw out if owner level is set * Add test for owner level * increase waiting time * Increase wait time to receive event * Correct test case for wrong key to send * Fix pylint error * update the version number * try version b6 * test code small fix * Further refactoring (#5) * Started some code clean up * More clean up * Refactored producer * Made async eventprocessor internal * Async clean up * Fixed locking behaviour * Merge updates * Fix missing lock * Review feedback * Fix multi-line strings * Test fixes * Pylint fixes * Fixed capabilities * Typo * Fix for producer shutdown * Fix editing error * Update ALL_PARTITION * Renamed logger * utc timestamps * Refactor _Address * Review feedback * More review feedback * Pylint fixes * Skip wrong hostname test on darwin * Skip wrong hostname test on darwin * Review feedback * Retry exception context * increase wait time in live test * increase wait time for owner level test * Review feedback * Perf patch * Pylint fixes * using None for default timeout * User agent prefix constant * Updated samples and snippets * Increase wait time to 6 seconds for client auth test * Add aiohttp in eventhubs dev_req * Only install aiohttp for py3.5+ * Fix client auth async test * Enlarge wait time to receive * Enlarge wait time to receive
…ack2-control-client-queue-create-tests Initial commit of queue creation tests
* CodeGen from PR 14935 in Azure/azure-rest-api-specs [EdgeOrder] Update 2020-12-01-preview swagger and add readme files (Azure#14935) * new api changes (#1) * new api changes * referer url change * EdgeOrder 2020-12-01-preview Swagger changes (#5) * readme changes * Swagger refresh and update examples * Change examples as per oav validations * Minor swagger modifications * Minor spacing adjustments * Set ModelAsString to true for enums and modify examples * Fix swagger lint validation error * Modify readme and examples * Modify readme.go.md * Update swagger * Minor prettier fix * Change python package version in readme * Fix spell check error Co-authored-by: sashanm <[email protected]> * version,CHANGELOG Co-authored-by: SDKAuto <[email protected]> Co-authored-by: sashanm <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Zed Lei <[email protected]>
No description provided.