-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
221 additions
and
63 deletions.
There are no files selected for viewing
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
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
19 changes: 19 additions & 0 deletions
19
src/Microsoft.Azure.WebJobs.Host/Executors/FunctionInstanceFactoryContext.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Microsoft.Azure.WebJobs.Host.Protocols; | ||
|
||
namespace Microsoft.Azure.WebJobs.Host.Executors | ||
{ | ||
internal class FunctionInstanceFactoryContext | ||
{ | ||
public Guid Id { get; set; } | ||
public Guid? ParentId { get; set; } | ||
public ExecutionReason ExecutionReason { get; set; } | ||
public IDictionary<string, object> Parameters { get; set; } | ||
public Func<Func<Task>, Task> InvokeHandler { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Microsoft.Azure.WebJobs.Host/Executors/FunctionInstanceFactoryContextOfT.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.Azure.WebJobs.Host.Executors | ||
{ | ||
internal class FunctionInstanceFactoryContext<TTriggerValue> : FunctionInstanceFactoryContext | ||
{ | ||
public TTriggerValue TriggerValue { get; set; } | ||
} | ||
} |
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
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
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
6 changes: 1 addition & 5 deletions
6
src/Microsoft.Azure.WebJobs.Host/Executors/IFunctionInstanceFactory.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.Azure.WebJobs.Host.Protocols; | ||
|
||
namespace Microsoft.Azure.WebJobs.Host.Executors | ||
{ | ||
internal interface IFunctionInstanceFactory | ||
{ | ||
IFunctionInstance Create(Guid id, Guid? parentId, ExecutionReason reason, IDictionary<string, object> parameters); | ||
IFunctionInstance Create(FunctionInstanceFactoryContext context); | ||
} | ||
} |
19 changes: 13 additions & 6 deletions
19
src/Microsoft.Azure.WebJobs.Host/Executors/IFunctionInvoker.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.Azure.WebJobs.Host.Executors | ||
namespace Microsoft.Azure.WebJobs.Host | ||
{ | ||
internal interface IFunctionInvoker | ||
/// <summary> | ||
/// Provides an interface for invoking a job function. | ||
/// </summary> | ||
public interface IFunctionInvoker | ||
{ | ||
IReadOnlyList<string> ParameterNames { get; } | ||
|
||
// The cancellation token, if any, is provided along with the other arguments. | ||
/// <summary> | ||
/// Invoke the function. | ||
/// </summary> | ||
/// <param name="arguments">The arguments to invoke the function with.</param> | ||
/// <returns>A <see cref="Task"/> representing the invocation.</returns> | ||
/// <remarks> | ||
/// The cancellation token (if any) is provided along with the arguments. | ||
/// </remarks> | ||
Task InvokeAsync(object[] arguments); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Microsoft.Azure.WebJobs.Host/Executors/IFunctionInvokerProvider.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.Azure.WebJobs.Host | ||
{ | ||
/// <summary> | ||
/// Defines an interface for the creation of <see cref="IFunctionInvoker"/> instances. | ||
/// </summary> | ||
public interface IFunctionInvokerProvider | ||
{ | ||
/// <summary> | ||
/// Creates a <see cref="IFunctionInvoker"/>. | ||
/// </summary> | ||
/// <param name="invoker">The default inner invoker.</param> | ||
/// <returns>The <see cref="IFunctionInvoker"/>.</returns> | ||
IFunctionInvoker Create(IFunctionInvoker invoker); | ||
} | ||
} |
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
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
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
5 changes: 2 additions & 3 deletions
5
src/Microsoft.Azure.WebJobs.Host/Triggers/ITriggeredFunctionInstanceFactory.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using Microsoft.Azure.WebJobs.Host.Executors; | ||
|
||
namespace Microsoft.Azure.WebJobs.Host.Triggers | ||
namespace Microsoft.Azure.WebJobs.Host | ||
{ | ||
internal interface ITriggeredFunctionInstanceFactory<TTriggerValue> : IFunctionInstanceFactory | ||
{ | ||
IFunctionInstance Create(TTriggerValue value, Guid? parentId); | ||
IFunctionInstance Create(FunctionInstanceFactoryContext<TTriggerValue> context); | ||
} | ||
} |
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
Oops, something went wrong.