---
title: "CFReadStreamScheduleWithRunLoop(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfreadstreamschedulewithrunloop(_:_:_:)"
---

# CFReadStreamScheduleWithRunLoop(_:_:_:)

Schedules a stream into a run loop.

## Declaration

```swift
func CFReadStreamScheduleWithRunLoop(_ stream: CFReadStream!, _ runLoop: CFRunLoop!, _ runLoopMode: CFRunLoopMode!)
```

## Parameters

- `stream`: The stream to schedule.
- `runLoop`: The run loop with which to schedule stream.
- `runLoopMode`: The run loop mode of runLoop in which to schedule stream.

## Discussion

Discussion After scheduling stream with a run loop, its client (set with CFReadStreamSetClient(_:_:_:_:)) is notified when various events happen with the stream, such as when it finishes opening, when it has bytes available, and when an error occurs. A stream can be scheduled with multiple run loops and run loop modes. Use CFReadStreamUnscheduleFromRunLoop(_:_:_:) to later remove stream from the run loop.

## See Also

### Scheduling a Read Stream

- [CFReadStreamUnscheduleFromRunLoop(_:_:_:)](corefoundation/cfreadstreamunschedulefromrunloop(_:_:_:).md)
