# US 2015/0106825 A1 · Durable execution of long running applications

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2015/0106825 A1
- Document ID: US20150106825A1
- Status: Published application
- Kind: A1
- Application number: 14/051,265
- Filed: 2013-10-10
- Published: 2015-04-16
- Earliest claimed: 2013-10-10
- Assignees: Microsoft Corporation
- Applicants: Microsoft Corporation
- Inventors: Samar Abbas; Muralidhar Krishnaprasad; Affan Arshad Dar
- Web page: https://patentgrep.com/patent/US20150106825A1

## CPC

- G06F 9/542: {Event management; Broadcasting; Multicasting; Notifications}
- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06F 11/1438: {Restarting or rejuvenating}
- G06F 9/4862: {the task being a mobile agent, i.e. specifically designed to migrate}
- G06F 11/1471: involving logging of persistent data for recovery
- G06F 2209/548: Queue
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Executing a long running application while maintaining state of the application. A method includes identifying that a new event has taken place with respect to an execution of an orchestration. The method includes establishing the state of the orchestration by replaying the execution of the orchestration by replaying any previous state from a history of the execution of the orchestration. The method further includes executing a next instruction of the execution of the orchestration. The next instruction is an instruction coded in the orchestration to execute after items in the history have been replayed.

## Claims

### Claim 1

In a distributed computing environment, configured to execute long running applications, a method of executing a long running application while maintaining state of the application the method comprising:
identifying that a new event has taken place with respect to an execution of an orchestration,
as a result of identifying that a new event has taken place with respect to the execution of the orchestration, establishing the state of the execution of the orchestration by replaying any previous state from a history of the execution of the orchestration, wherein the previous state in the history of the execution of the orchestration was added to the history of the running execution of the orchestration as a result of executing previous instructions of the orchestration; and
after replaying any previous state from a history of the execution of the orchestration, executing a next instruction of the orchestration, the next instruction being an instruction coded in the orchestration to execute after items in the history have been replayed.

### Claim 2 (depends on 1)

The method of claim 1, further comprising repeating the acts of claim 1 until all instructions in the orchestration have been executed.

### Claim 3 (depends on 1)

The method of claim 1, wherein executing a next instruction comprises making a call to a long running application activity.

### Claim 4 (depends on 1)

The method of claim 1, wherein identifying that a new event has taken place comprises identifying that an asynchronous event has occurred due to the completion of work resulting from an asynchronous instruction in a long running application framework.

### Claim 5 (depends on 4)

The method of claim 4, further comprising identifying asynchronous instructions by a specific language call indicating that the instruction is asynchronous.

### Claim 6 (depends on 1)

The method of claim 1, wherein identifying that a new event has taken place comprises identifying that a timer has fired.

### Claim 7 (depends on 1)

The method of claim 1, wherein identifying that a new event has taken place comprises identifying that a sub-orchestration is to be created to extend the life of a long-running application.

### Claim 8 (depends on 1)

The method of claim 1, wherein identifying that a new event has taken place comprises identifying that an event external to the long running application framework has occurred.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
accessing an orchestration, the orchestration comprising a plurality of instructions including one or more asynchronous instructions;
executing an asynchronous instruction from the orchestration,
storing state created by execution of the asynchronous instruction in a running history of an execution of the orchestration.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
placing an indication of the event on an application queue;
wherein executing a next instruction results in:
the indication being removed from the application queue;
an indication being added to an implementation queue;
the history being updated to add state created as a result of executing the new instruction to the history; and
wherein removing from application queue, adding to the implementation queue, and updating history is performed transactionally such that all three successfully complete and commit or abort and are rolled back.

### Claim 11

A physical computer readable storage medium comprising computer executable instructions that when executed by one or more processors cause the following to be performed:
identifying that a new event has taken place with respect to an execution of an orchestration,
as a result of identifying that a new event has taken place with respect to the execution of the orchestration, establishing the state of the execution of the orchestration by replaying any previous state from a history of the execution of the orchestration, wherein the previous state in the history of the execution of the orchestration was added to the history of the running execution of the orchestration as a result of executing previous instructions of the orchestration; and
after replaying any previous state from a history of the execution of the orchestration, executing a next instruction of the orchestration, the next instruction being an instruction coded in the orchestration to execute after items in the history have been replayed.

### Claim 12 (depends on 11)

The computer readable medium of claim 11, further comprising computer executable instructions that when executed by one or more processors cause repeating the acts of claim 11 until all instructions in the the orchestration have been executed.

### Claim 13 (depends on 11)

The computer readable medium of claim 11, wherein executing a next instruction comprises making a call to a long running application activity.

### Claim 14 (depends on 11)

The computer readable medium of claim 11, wherein identifying that a new event has taken place comprises identifying that an asynchronous event has occurred due to the completion of work resulting from an asynchronous instruction in a long running application framework.

### Claim 15 (depends on 11)

The computer readable medium of claim 11, wherein identifying that a new event has taken place comprises identifying that a timer has fired.

### Claim 16 (depends on 11)

The computer readable medium of claim 11, wherein identifying that a new event has taken place comprises identifying that a sub-orchestration is to be created to extend the life of a long-running application.

### Claim 17 (depends on 11)

The computer readable medium of claim 11, wherein identifying that a new event has taken place comprises identifying that an event external to the long running application framework has occurred.

### Claim 18 (depends on 11)

The computer readable medium of claim 11, further comprising computer executable instructions that when executed by one or more processors cause the following to be performed:
accessing an orchestration, the orchestration comprising a plurality of instructions including one or more asynchronous instructions;
executing an asynchronous instruction from the orchestration,
storing state created by execution of the asynchronous instruction in a running history of an execution of the orchestration.

### Claim 19 (depends on 11)

The computer readable medium of claim 11, further comprising computer executable instructions that when executed by one or more processors cause the following to be performed:
placing an indication of the event on an application queue;
wherein executing a next instruction results in:
the indication being removed from the application queue;
an indication being added to an implementation queue;
the history being updated to add state created as a result of executing the new instruction to the history; and
wherein removing from application queue, adding to the implementation queue, and updating history is performed transactionally such that all three successfully complete and commit or abort and are rolled back.

### Claim 20

A system for executing a long running application while maintaining state of the application the system comprising:
one or more processors; and
one or more computer readable media, wherein the one or more computer readable media comprise computer executable instructions that when executed by at least one of the one or more processors cause at least one of the one or more processors to perform the following:
identifying that a new asynchronous event has taken place with respect to an execution of an orchestration as the result of an asynchronous call being executed in a long running application framework,
as a result of identifying that a new asynchronous event has taken place with respect to the execution of the orchestration, establishing the state of the execution of the orchestration by replaying any previous state from a history of the execution of the orchestration, wherein the previous state in the history of the orchestration was added to the history of the running execution of the orchestration as a result of executing previous instructions of the running execution of the orchestration; and
after replaying any previous state from a history of the execution of the orchestration, executing a next instruction of the running execution of the orchestration, the next instruction being an instruction coded in the orchestration to execute after items in the history have been replayed.
