Skip to content

Commit f4ed4f6

Browse files
(Azure CXP) Added note on the SingletonMode.Function
https://github.com/MicrosoftDocs/azure-docs/issues/54096
1 parent 880aa54 commit f4ed4f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

articles/app-service/webjobs-sdk-how-to.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,9 @@ Some triggers have built-in support for concurrency management:
746746

747747
You can use these settings to ensure that your function runs as a singleton on a single instance. To ensure that only a single instance of the function is running when the web app scales out to multiple instances, apply a listener-level singleton lock on the function (`[Singleton(Mode = SingletonMode.Listener)]`). Listener locks are acquired when the JobHost starts. If three scaled-out instances all start at the same time, only one of the instances acquires the lock and only one listener starts.
748748

749+
> [!NOTE]
750+
> See this [Github Repo](https://github.com/Azure/azure-webjobs-sdk/blob/master/src/Microsoft.Azure.WebJobs/SingletonMode.cs) to learn more about how the SingletonMode.Function works.
751+
749752
### Scope values
750753

751754
You can specify a *scope expression/value* on a singleton. The expression/value ensures that all executions of the function at a specific scope will be serialized. Implementing more granular locking in this way can allow for some level of parallelism for your function while serializing other invocations as dictated by your requirements. For example, in the following code, the scope expression binds to the `Region` value of the incoming message. When the queue contains three messages in regions East, East, and West respectively, the messages that have region East are run serially while the message with region West is run in parallel with those in East.

0 commit comments

Comments
 (0)