Click or drag to resize
AppBuilderExtensionsUseHangfireServer Method (IAppBuilder, JobStorage, BackgroundJobServerOptions, IBackgroundProcess)
Starts a new instance of the BackgroundJobServer class with the given arguments, and registers its disposal on application shutdown.

Namespace: Hangfire
Assembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax
public static IAppBuilder UseHangfireServer(
	[NotNullAttribute] this IAppBuilder builder,
	[NotNullAttribute] JobStorage storage,
	[NotNullAttribute] BackgroundJobServerOptions options,
	[NotNullAttribute] params IBackgroundProcess[] additionalProcesses
)

Parameters

builder
Type: IAppBuilder
OWIN application builder.
storage
Type: HangfireJobStorage
Storage to use by background job server.
options
Type: HangfireBackgroundJobServerOptions
Options for background job server.
additionalProcesses
Type: Hangfire.ServerIBackgroundProcess
Collection of additional background processes.

Return Value

Type: IAppBuilder

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IAppBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionbuilder is null.
ArgumentNullExceptionstorage is null.
ArgumentNullExceptionoptions is null.
ArgumentNullExceptionadditionalProcesses is null.
InvalidOperationException OWIN environment does not contain the application shutdown cancellation token.
Remarks
Please see AppBuilderExtensions for details and examples.
See Also