> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# SimpleMessageBusFileProcessor

> Default file processor used by [FileTriggerAttribute](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.filetriggerattribute).

## Definition

**Assembly:** CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll

**Namespace:** CloudNimble.SimpleMessageBus.Dispatch.Triggers

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessor
```

## Summary

Default file processor used by [FileTriggerAttribute](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.filetriggerattribute).

## Constructors

### &#x20;.ctor

Constructs a new instance.

#### Syntax

```csharp theme={"dark"}
public SimpleMessageBusFileProcessor(CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessorFactoryContext context)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `context` | `CloudNimble.SimpleMessageBus.Dispatch.Triggers.SimpleMessageBusFileProcessorFactoryContext` | The [SimpleMessageBusFileProcessorFactoryContext](https://easyaf.nimbleapps.cloud/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessorFactoryContext.md) to use. |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### &#x20;InstanceId Virtual

Gets the current role instance ID. In Azure WebApps, this will be the
WEBSITE\_INSTANCE\_ID. In non Azure scenarios, this will default to the
Process ID.

#### Syntax

```csharp theme={"dark"}
public virtual string InstanceId { get; }
```

#### Property Value

Type: `string`

### &#x20;MaxDegreeOfParallelism Virtual

Gets the maximum degree of parallelism that will be used
when processing files concurrently.

#### Syntax

```csharp theme={"dark"}
public virtual int MaxDegreeOfParallelism { get; }
```

#### Property Value

Type: `int`

#### Remarks

Files are added to an internal processing queue as file events
are detected, and they're processed in parallel based on this setting.

### &#x20;MaxProcessCount Virtual

Gets the maximum number of times file processing will
be attempted for a file.

#### Syntax

```csharp theme={"dark"}
public virtual int MaxProcessCount { get; }
```

#### Property Value

Type: `int`

### &#x20;MaxQueueSize Virtual

Gets the bounds on the maximum number of files that can be queued
up for processing at one time. When set to -1, the work queue is
unbounded.

#### Syntax

```csharp theme={"dark"}
public virtual int MaxQueueSize { get; }
```

#### Property Value

Type: `int`

### &#x20;StatusFileExtension Virtual

Gets the file extension that will be used for the status files
that are created for processed files.

#### Syntax

```csharp theme={"dark"}
public virtual string StatusFileExtension { get; }
```

#### Property Value

Type: `string`

## Methods

### &#x20;Cleanup Virtual

Perform any required cleanup. This includes deleting processed files
(when [AutoDelete](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.filetriggerattribute.autodelete) is True).

#### Syntax

```csharp theme={"dark"}
public virtual void Cleanup()
```

### &#x20;CleanupProcessedFiles Virtual

Clean up any files that have been fully processed

#### Syntax

```csharp theme={"dark"}
public virtual void CleanupProcessedFiles()
```

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ProcessFileAsync Virtual

Process the file indicated by the specified [FileSystemEventArgs](https://learn.microsoft.com/dotnet/api/system.io.filesystemeventargs).

#### Syntax

```csharp theme={"dark"}
public virtual System.Threading.Tasks.Task<bool> ProcessFileAsync(System.IO.FileSystemEventArgs eventArgs, System.Threading.CancellationToken cancellationToken)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `eventArgs` | `System.IO.FileSystemEventArgs` | The [FileSystemEventArgs](https://learn.microsoft.com/dotnet/api/system.io.filesystemeventargs) indicating the file to process. |
| `cancellationToken` | `System.Threading.CancellationToken` | The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use. |

#### Returns

Type: `System.Threading.Tasks.Task<bool>`
A [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) that returns true if the file was processed successfully, false otherwise.

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ShouldProcessFile Virtual

Determines whether the specified file should be processed.

#### Syntax

```csharp theme={"dark"}
public virtual bool ShouldProcessFile(string filePath)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `filePath` | `string` | The candidate file for processing. |

#### Returns

Type: `bool`
True if the file should be processed, false otherwise.

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.