Azure / Azure/azure-sdk-for-java

Clientcore poller design considerations

Open
#44,720 0 comments 0 reactions 0 assignees View on GitHub
Azure.Core.V2 clientcore
Dominant language
Java
Stars
2.6k
Forks
2.2k
Avg merge
2d 8h
Merged PRs (30d)
178

Description

Reference PR - https://github.com/Azure/azure-sdk-for-java/pull/44670

Comments from @alzimmermsft

1. Race conditions in chained polling strategy
> Can ChainedPollingStrategy be re-used in multiple locations? If it can, we may need to harden this method to prevent race conditions from happening.

2. Revisit polling strategy constructors and order of evaluation of polling strategies
> Do we have any concerns with the design of this type? Such as the opinions on which strategy are included here and with which order they are?

3. Customizable headers for `OperationResourcePollingStrategy`
> Why don't we provide a way to set the HTTP header inspected by OperationResourcePollingStrategy in any of these constructor methods?

4. PollingContext redesign
> Now that we're given a chance to make breaking changes, is there anything we'd want to change about PollingContext? Possibly elevating some key-value pairs in this Map to typed properties on this class?

5. Do we need the Poller interface?
> Do we need to have an interface and class for implementing polling? Could we instead just use SimplePoller directly in public API?

6. Expandable enum caching
> If we're not going to cache instance created here we don't really need to use a backing Map to store constants defined by the ExpandableEnum. Rather we could do simple string equivalence checking that'd should be more performant as map usage will require scanning name at least once for its hash to determine the map bucket and zero to a few times to compare it against keys found in the bucket. This logic would be a basic initial check on name.length() matching known lengths, if not matched we know this is new, and then casing on length matches to do direct value comparisons.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.