File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 55import collections
66import collections .abc
77import dataclasses
8+ import functools
89import inspect
910import json
1011import sys
@@ -352,9 +353,6 @@ def __init__(self, *converters: EncodingPayloadConverter) -> None:
352353 converters: Payload converters to delegate to, in order.
353354 """
354355 self ._set_converters (* converters )
355- self ._any_converter_takes_context = any (
356- isinstance (c , WithSerializationContext ) for c in converters
357- )
358356
359357 def _set_converters (self , * converters : EncodingPayloadConverter ) -> None :
360358 self .converters = {c .encoding .encode (): c for c in converters }
@@ -453,6 +451,12 @@ def get_converters_with_context(
453451
454452 return converters if any_with_context else None
455453
454+ @functools .cached_property
455+ def _any_converter_takes_context (self ) -> bool :
456+ return any (
457+ isinstance (c , WithSerializationContext ) for c in self .converters .values ()
458+ )
459+
456460
457461class DefaultPayloadConverter (CompositePayloadConverter ):
458462 """Default payload converter compatible with other Temporal SDKs.
You can’t perform that action at this time.
0 commit comments