> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .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](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/Triggers/SimpleMessageBusFileProcessorFactoryContext) to use. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> InstanceId <Badge color="orange">Virtual</Badge>

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`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MaxDegreeOfParallelism <Badge color="orange">Virtual</Badge>

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.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MaxProcessCount <Badge color="orange">Virtual</Badge>

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`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MaxQueueSize <Badge color="orange">Virtual</Badge>

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`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> StatusFileExtension <Badge color="orange">Virtual</Badge>

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

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Cleanup <Badge color="orange">Virtual</Badge>

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()
```

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> CleanupProcessedFiles <Badge color="orange">Virtual</Badge>

Clean up any files that have been fully processed

#### Syntax

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

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `object`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ProcessFileAsync <Badge color="orange">Virtual</Badge>

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.

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ShouldProcessFile <Badge color="orange">Virtual</Badge>

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.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `string?`
