-
Notifications
You must be signed in to change notification settings - Fork 104
Early client impl and docs scaffolding #6
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
Conversation
return next | ||
|
||
|
||
class OutboundInterceptor: |
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.
Maybe call this BaseOutboundInterceptor
?
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.
I am not sure it has value anymore than a suggestion to call it BaseTemporalError
would. While some Python classes do this, it's by no means universal (it's not BaseIntEnum
or BaseTypedDict
).
Also, I am intentionally allowing this to be instantiated directly (this will be especially true with classes temporalio.worker.WorkflowOutboundInterceptor
) for the default implementation. I intentionally do not make these @abstractmethod
or extend ABC
for that reason.
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.
I'm fine with the naming, not sure why we need to allow direct instantiation though for the outbound interceptor though.
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.
Usually when subclassing you don't have to, but if people wanted to use composition instead they'd want to. Being able to make a "default interceptor" could have benefits in a ternary, e.g. interceptor = my_interceptor or OutboundInterceptor
. Otherwise, it's just general decent practice to not force something to be abstract/base that has no implementation requirements.
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.
I don't see much value in having an empty interceptor in the chain TBH but with the inheritance based approach I can see why you'd want to allow this.
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.
I don't see much value in it either. I just don't like making something abstract unnecessarily. I would just as soon call this DefaultOutboundInterceptor
.
return next | ||
|
||
|
||
class OutboundInterceptor: |
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.
I don't see much value in having an empty interceptor in the chain TBH but with the inheritance based approach I can see why you'd want to allow this.
pass | ||
|
||
|
||
class FailureError(TemporalError): |
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.
I'm fine with FailureError
or TemporalFailureError
. Prefer them over ServiceError
because of the ApplicationError
dissonance.
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.
Yeah that's fair. TemporalFailureError is a bit of a mouthful but maybe the most understandable
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.
It's in the temporalio
namespace and I prefer not to stutter (people more often qualify their references in Python than Typescript). I only prefixed Temporal
as the root error.
Enough consensus reached, merging. |
What was changed