Created
July 28, 2012 12:27
-
-
Save adamcameron/3193092 to your computer and use it in GitHub Desktop.
Investigation into applicationStop(): http://bit.ly/OlLnTM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Application.cfc | |
component { | |
this.name = "testApplicationStop"; | |
this.applicationTimeout = createTimeSpan(0, 0, 1, 0); | |
function onApplicationStart(){ | |
application.key = createUuid(); | |
application.startedAt = timeFormat(now(), "HH:MM:SS.LLL") & "<br />"; | |
application.firstVar = "First var using #application.startedAt#"; | |
application.secondVar = "Second using #application.startedAt#"; | |
param name="server.requestCount" default=0; | |
} | |
function onRequestStart(){ | |
request.requestId = ++server.requestCount; | |
request.appKey = application.key; | |
writeLog(file=this.name, text="Request #request.requestId# of #listLast(getBaseTemplatePath(), "\")# started at #formattedNow()# for application key: #application.key# (#request.appKey#)"); | |
} | |
function onRequestEnd(){ | |
writeLog(file=this.name, text="Request #request.requestId# of #listLast(getBaseTemplatePath(), "\")# ended at #formattedNow()# for application key: #application.key# (#request.appKey#)"); | |
} | |
function formattedNow(){ | |
return timeFormat(now(), "HH:MM:SS.LLL"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- long.cfm ---> | |
<cfflush interval="1"> | |
<cfoutput> | |
#application.firstVar#<br /> | |
<!---emulate a long-running request ---> | |
<cfset sleep(10000)> | |
#application.secondVar#<br /> | |
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- other.cfm ---> | |
<cfflush interval="1"> | |
<cfoutput> | |
#application.firstVar#<br /> | |
#application.secondVar#<br /> | |
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- start.cfm ---> | |
<cfdump var="#application#" label="Started"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- stop.cfm ---> | |
<cfset applicationStop()> | |
<cfdump var="#application#" label="Stopped"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment