You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ This release adds support to pass `None` values via channels and revamps the `Ti
8
8
9
9
*`util.Timer` was replaced by a more generic implementation that allows for customizable policies to handle missed ticks.
10
10
11
-
If you were using `Timer` to implement timeouts, these two pices of code should be almost equivalent:
11
+
If you were using `Timer` to implement timeouts, these two pieces of code should be almost equivalent:
12
12
13
13
- Old:
14
14
@@ -27,7 +27,7 @@ This release adds support to pass `None` values via channels and revamps the `Ti
27
27
28
28
They are not**exactly** the same because the `triggered_datetime`in the second case will not be exactly when the timer had triggered, but that shouldn't be relevant, the important part is when your code can actually react to the timer trigger and to know how much drift there was to be able to take corrective actions.
29
29
30
-
Also the new `Timer` uses the `asyncio` loop monotonic clock and the old one used the wall clock (`datetime.now()`) to track time. This means that when using `async-solipsism` to test, the new `Timer` will always trigger immediately regarless of the state of the wall clock. This also means that we don't need to mock the wall clock with `time-machine` either now.
30
+
Also the new `Timer` uses the `asyncio` loop monotonic clock and the old one used the wall clock (`datetime.now()`) to track time. This means that when using `async-solipsism` to test, the new `Timer` will always trigger immediately regardless of the state of the wall clock. This also means that we don't need to mock the wall clock with `time-machine` either now.
31
31
32
32
With the previous timer one needed to create a separate task to run the timer, because otherwise it would block as it loops until the wall clock was at a specific time. Now the code will run like this:
33
33
@@ -39,7 +39,7 @@ This release adds support to pass `None` values via channels and revamps the `Ti
39
39
40
40
# Simulates a delay in the timer trigger time
41
41
asyncio.sleep(1.5) # Advances the loop monotonic clock by 1.5 seconds immediately
42
-
await drift = timer.receive() # The timer should have triggerd 0.5 seconds ago, so it doesn't even sleep
42
+
await drift = timer.receive() # The timer should have triggered 0.5 seconds ago, so it doesn't even sleep
43
43
assert drift == approx(timedelta(seconds=0.5)) # Now we should observe a drift of 0.5 seconds
44
44
```
45
45
@@ -53,12 +53,19 @@ This release adds support to pass `None` values via channels and revamps the `Ti
53
53
54
54
Therefore, you should now check a file receiving an event really exist before trying to operate on it.
55
55
56
+
*`FileWatcher` reports the type of event observed in addition to the file path.
57
+
58
+
Previously, only the file path was reported. With this update, users can now determine if a file change is a creation, modification, or deletion.
59
+
Note that this change may require updates to your existing code that relies on `FileWatcher` as the new interface returns a `FileWatcher.Event` instead of just the file path.
60
+
56
61
## New Features
57
62
58
63
*`util.Timer` was replaced by a more generic implementation that allows for customizable policies to handle missed ticks.
59
64
60
65
* Passing `None` values via channels is now supported.
61
66
67
+
*`FileWatcher.Event` was added to notify events when a file is created, modified, or deleted.
68
+
62
69
## Bug Fixes
63
70
64
71
*`util.Select` / `util.Merge` / `util.MergeNamed`: Cancel pending tasks in `__del__` methods only if possible (the loop is not already closed).
0 commit comments