Skip to content

Commit

Permalink
docs: Expand subscription documentation after #1244
Browse files Browse the repository at this point in the history
  • Loading branch information
ecederstrand committed Oct 31, 2023
1 parent 6a8289a commit 3972249
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,21 @@ for change_type, item in a.inbox.sync_items():
# a.inbox.item_sync_state.
```

EWS allows subscribing to changes in a mailbox. There are three types of subscriptions; pull,
push and streaming. For each type, you can subscribe to all folders at once, to a single
folder, or to a collection of folders (see description of `FolderCollection` above). In the
following, we show only examples for subscriptions on `Account.inbox`, but the others are
also possible.

Here's how to create a pull subscription that can be used to pull events from the server:
```python
# Subscribe to all folders
subscription_id, watermark = a.subscribe_to_pull()

# Subscribe to a collection of folders
subscription_id, watermark = a.inbox.glob("foo*").subscribe_to_pull()

# Subscribe to one folder
subscription_id, watermark = a.inbox.subscribe_to_pull()
```

Expand Down

0 comments on commit 3972249

Please sign in to comment.