def prepare(self, invocation): """setup per invocation """ if invocation.caller: caller = invocation.caller self.caller = SdkAddress(caller.namespace, caller.type, caller.id) else: self.caller = None
def sdk_address_from_pb(addr: Address) -> typing.Optional[SdkAddress]: if not addr: return None return SdkAddress(namespace=addr.namespace, name=addr.type, id=addr.id, typename=f"{addr.namespace}/{addr.type}")
def __init__(self, target, states): # remember own address self.address = SdkAddress(target.namespace, target.type, target.id) # the caller address would be set for each individual invocation in the batch self.caller = None # outgoing messages self.invocation_pairs = [] self.success_response = {} self.failure_response = {}
def __init__(self, target, states): self.states = states # remember own address self.address = SdkAddress(target.namespace, target.type, target.id) # the caller address would be set for each individual invocation in the batch self.caller = None # outgoing messages self.messages = [] self.delayed_messages = [] self.egresses = []
def __init__(self, target, states): # populate the state store with the eager state values provided in the batch self.states = {s.state_name: AnyStateHandle(s.state_value) for s in states} # remember own address self.address = SdkAddress(target.namespace, target.type, target.id) # the caller address would be set for each individual invocation in the batch self.caller = None # outgoing messages self.messages = [] self.delayed_messages = [] self.egresses = []