Skip to content

Commit 1aa6a40

Browse files
authored
Merge pull request #267 from sshanks-kx/zw
4.1 change to .z.W output
2 parents 139bf6e + 167c556 commit 1aa6a40

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

docs/kb/deferred-response.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ You can use `-30!(::)` at any place in the execution path of [`.z.pg`](../ref/do
1818
Kdb+ tracks which handles are expecting a response. If you try to send a response to a handle that is not expecting one, you’ll see
1919

2020
```q
21-
q).z.W / list of socket handles being monitored by kdb+ main thread
22-
8i
21+
q)key .z.W / list of socket handles being monitored by kdb+ main thread
22+
, 8i
2323
q)-30!(8i;0b;`hello`world) / try to send a response of (0b;`hello`world)
2424
'Handle 8 was not expecting a response msg
2525
[0] -30!(8i;0b;`hello`world)

docs/ref/dotz.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,21 @@ q)h:hopen ...
876876
q)h
877877
3
878878
q)neg[h]({};til 1000000); neg[h]({};til 10); .z.W
879-
3| 4000030 70
880-
q)sum each .z.W
881-
3| 0
879+
3| 8000030 110
880+
q)neg[h]({};til 1000000); neg[h]({};til 10); sum each .z.W
881+
3| 8000140
882+
```
883+
884+
Since 4.1 2023.09.15, this returns `handles!bytes` as `I!J`, instead of the former `handles!list` of individual msg sizes. Use `sum each .z.W` if writing code targetting 4.0 and 4.1
885+
886+
```q
887+
q)h:hopen ...
888+
q)h
889+
6i
890+
q)neg[h]({};til 1000000); neg[h]({};til 10); .z.W
891+
6| 8000140
892+
q)neg[h]({};til 1000000); neg[h]({};til 10); sum each .z.W
893+
6| 8000140
882894
```
883895

884896

docs/releases/ChangesIn4.1.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,7 @@ q)H:hopen each 4#4000;{x""}peach H
290290
q))
291291
```
292292
[One-shot IPC requests](../ref/hopen.md#one-shot-request) can be used within peach instead.
293+
294+
### .z.W
295+
296+
[.z.W](../ref/dotz.md#zw-handles) now returns `handles!bytes` as `I!J`, instead of the former `handles!list` of individual msg sizes. Use `sum each .z.W` if writing code targetting 4.0 and 4.1.

0 commit comments

Comments
 (0)