---
title: "setLimit(highWater:)"
framework: dispatch
role: symbol
role_heading: Instance Method
path: "dispatch/dispatchio/setlimit(highwater:)"
---

# setLimit(highWater:)

Sets the maximum number of bytes to process before enqueueing a handler block.

## Declaration

```swift
func setLimit(highWater high_water: Int)
```

## Parameters

- `high_water`: The maximum number of bytes to read or write before enqueueing the corresponding I/O handler block.

## Discussion

Discussion During a read or write operation, the channel uses the high- and low-water mark values to determine how often to enqueue the associated handler block. It enqueues the block when the number of bytes read or written is between these two values. The default high-water mark for channels is set to SIZE_MAX.

## See Also

### Managing the File Descriptor

- [fileDescriptor](dispatch/dispatchio/filedescriptor.md)
- [setLimit(lowWater:)](dispatch/dispatchio/setlimit(lowwater:).md)
- [setInterval(interval:flags:)](dispatch/dispatchio/setinterval(interval:flags:).md)
- [DispatchIO.IntervalFlags](dispatch/dispatchio/intervalflags.md)
