Skip to content

Commit

Permalink
feat: add signal and forceSignal
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Feb 12, 2024
1 parent a1143f3 commit 8a38d8b
Show file tree
Hide file tree
Showing 12 changed files with 808 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-eels-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"async-call-rpc": minor
---

add signal and forceSignal
2 changes: 1 addition & 1 deletion __tests__/__file_snapshots__/async-call-batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Array [

```php
Array [
"In this part it should be no log",
"In this part it should has no log",
]
```

Expand Down
125 changes: 125 additions & 0 deletions __tests__/__file_snapshots__/async-call-client-abort-signal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Timeline

## T=0 Message: client sent

```php
Object {
"id": 0,
"jsonrpc": "2.0",
"method": "delay",
"params": Array [
200,
"first",
],
}
```

## T=1 Message: client sent

```php
Object {
"id": 1,
"jsonrpc": "2.0",
"method": "delay",
"params": Array [
400,
"second",
],
}
```

## T=2 Message: server received

```php
Object {
"id": 0,
"jsonrpc": "2.0",
"method": "delay",
"params": Array [
200,
"first",
],
}
```

## T=3 Log: server/log

```php
Array [
"rpc.%cdelay%c(%o, %o%c)
%o %c@0",
"color:#d2c057",
"",
200,
"first",
"",
Promise {},
"color:gray;font-style:italic;",
]
```

## T=4 Message: server received

```php
Object {
"id": 1,
"jsonrpc": "2.0",
"method": "delay",
"params": Array [
400,
"second",
],
}
```

## T=5 Log: server/log

```php
Array [
"rpc.%cdelay%c(%o, %o%c)
%o %c@1",
"color:#d2c057",
"",
400,
"second",
"",
Promise {},
"color:gray;font-style:italic;",
]
```

## T=6 Log: testRunner/log

```php
Array [
"soft abort",
]
```

## T=7 Message: server => client

```php
Object {
"id": 0,
"jsonrpc": "2.0",
"result": undefined,
}
```

## T=8 Log: testRunner/log

```php
Array [
"hard abort",
]
```

## T=9 Message: server => client

```php
Object {
"id": 1,
"jsonrpc": "2.0",
"result": undefined,
}
```
Loading

0 comments on commit 8a38d8b

Please sign in to comment.