Skip to content

Instantly share code, notes, and snippets.

@eduard93
Created March 4, 2020 05:47
Show Gist options
  • Save eduard93/8189a8d0454fc5f75a4b6b6abb0e5435 to your computer and use it in GitHub Desktop.
Save eduard93/8189a8d0454fc5f75a4b6b6abb0e5435 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2017.2.1 (Build 801U)" ts="2020-03-04 07:28:49">
<Class name="Timeout.Child">
<ClassType>persistent</ClassType>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>65442,25113.084596</TimeChanged>
<TimeCreated>65442,24047.302779</TimeCreated>
<Property name="Hang">
<Type>%Integer</Type>
<InitialExpression>10</InitialExpression>
<Parameter name="MINVAL" value="0"/>
</Property>
<Parameter name="SETTINGS">
<Default>Hang:Basic</Default>
</Parameter>
<Method name="OnRequest">
<FormalSpec>pRequest:Ens.StringContainer,*pResponse:Ens.StringContainer</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
$$$TRACE("OnRequest CHILD HANGing for " _ ..Hang)
hang ..Hang
set text = "OnRequest CHILD"
$$$TRACE(text)
set pResponse = ##class(Ens.StringContainer).%New(text)
quit $$$OK
]]></Implementation>
</Method>
<Method name="OnTimeout">
<FormalSpec><![CDATA[request:Ens.StringContainer,&response:Ens.StringContainer,callrequest:Ens.StringContainer,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set text = "TIMEOUT CHILD"
$$$TRACE(text)
set response = ##class(Ens.StringContainer).%New(text)
quit $$$OK
]]></Implementation>
</Method>
<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>ChildDefaultData</DefaultData>
<Data name="ChildDefaultData">
<Subscript>"Child"</Subscript>
<Value name="1">
<Value>Hang</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="Timeout.Parent">
<ClassType>persistent</ClassType>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>65442,26038.834445</TimeChanged>
<TimeCreated>65442,24002.296023</TimeCreated>
<Property name="Wait">
<Type>%Integer</Type>
<InitialExpression>5</InitialExpression>
<Parameter name="MINVAL" value="-1"/>
</Property>
<Parameter name="SETTINGS">
<Default>Wait:Basic</Default>
</Parameter>
<Method name="OnRequest">
<FormalSpec>pRequest:Ens.StringContainer,*pResponse:Ens.StringContainer</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set sc = ..SendRequestSync("Timeout.Child", pRequest, .pResponse, ..Wait)
if ($$$ISOK(sc) && ('$isObject(pResponse))) {
set text = "Caught timeout"
$$$TRACE(text)
set pResponse = ##class(Ens.StringContainer).%New(text)
}
quit sc
]]></Implementation>
</Method>
<Method name="OnResponse">
<Description>
Handle a 'Response'</Description>
<FormalSpec><![CDATA[request:Ens.StringContainer,&response:Ens.StringContainer,callrequest:%Library.Persistent,callresponse:%Library.Persistent,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set text = "OnResponse PARENT"
$$$TRACE(text)
quit $$$OK
]]></Implementation>
</Method>
<Method name="OnTimeout">
<FormalSpec><![CDATA[request:Ens.StringContainer,&response:Ens.StringContainer,callrequest:Ens.StringContainer,pCompletionKey:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set text = "TIMEOUT PARENT"
$$$TRACE(text)
set response = ##class(Ens.StringContainer).%New(text)
quit $$$OK
]]></Implementation>
</Method>
<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>ParentDefaultData</DefaultData>
<Data name="ParentDefaultData">
<Subscript>"Parent"</Subscript>
<Value name="1">
<Value>Wait</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="Timeout.Production">
<Super>Ens.Production</Super>
<TimeChanged>65442,24316.725924</TimeChanged>
<TimeCreated>65442,24316.725924</TimeCreated>
<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Timeout.Production" TestingEnabled="true">
<ActorPoolSize>2</ActorPoolSize>
<Item Name="Timeout.Parent" ClassName="Timeout.Parent" PoolSize="1" />
<Item Name="Timeout.Child" ClassName="Timeout.Child" PoolSize="1" />
</Production>
]]></Data>
</XData>
</Class>
</Export>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment