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
{{ message }}
Repository navigation
Commit 5c7ade0
Browse filesBrowse the repository at this point in the historyBrowse files
All modules compile at release 11 in one pass, without the second pass
that compiled the classes for Java 8. ClientFuture overrides
newIncompleteFuture as an ordinary override.
Copy file name to clipboardExpand all lines: design/client-api.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ low-level API stays as it is.
9
9
10
10
- Package `dev.onvoid.webrtc.client`, in the existing `webrtc-java` jar, exported by the
11
11
`webrtc.java` module.
12
-
- Java 8, like the rest of the module: no records, no sealed types, no `var`.
12
+
- Java 11, like the rest of the module: no records, no sealed types.
13
13
- Pure Java. Phase 1 needs no native or JNI changes and changes no existing signature.
14
14
15
15
## Decisions
@@ -20,7 +20,7 @@ These were open questions in the mockup. Each went with its recommendation.
20
20
|---|---|---|
21
21
| Where does it live? | A package in the existing jar, not a separate artifact. | Users get it without another dependency. It follows the core's releases. |
22
22
| Default perfect negotiation role? | Impolite by default. | Glare between two impolite peers fails with a `NegotiationException` that names the fix (make one side polite). Every example sets the role explicitly. |
23
-
| Plain `CompletableFuture` or an own type? | Plain `CompletableFuture`. |On Java 8, stages derived from a subclass are plain `CompletableFuture`s, so `BlockingCallException`only catches a `join()`/`get()` on the future the API returned. The exception message and the event thread names help with the rest. |
23
+
| Plain `CompletableFuture` or an own type? | Plain `CompletableFuture`. |The API returns a `ClientFuture` subclass behind the type, whose derived stages are `ClientFuture`s too, so `BlockingCallException` catches a `join()`/`get()` on them as well. The exception message and the event thread names help with the rest. |
24
24
| Does `Peer.close()` block? | No, never. | Safe in handlers and on UI threads. `closeAsync()` returns a future for callers who want to wait. `WebRtc.close()` is the one call that waits for everything. |
25
25
| A camera opened twice? | Shared when the options match, `MediaException` when they differ. | One capture per device. Most platforms can't open a device with two capabilities anyway. |
Copy file name to clipboardExpand all lines: docs/guide/client-api.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -331,10 +331,10 @@ A future that is already done may be read anywhere, and any thread that is not a
331
331
332
332
Each call returns a future of its own, also of `closeAsync()`, `whenClosed()`, `whenConnected()` and `whenOpen()`. Cancelling one only stops waiting: the close goes on, and the futures of other callers, and of the runtime's own close, are not affected.
333
333
334
-
::: warning
335
-
On Java 8, only the futures the API returns refuse to be waited on. Futures derived from them with `thenApply` and the like do not, so waiting for one of those in a handler hangs that peer. From Java 9 on, the derived futures refuse too.
334
+
Futures derived from them with `thenApply` and the like refuse to be waited on as well.
336
335
337
-
A UI thread used as event executor is the same: waiting on it for a future of this API hangs the UI, since the future completes on it.
336
+
::: warning
337
+
A UI thread used as event executor does not refuse: waiting on it for a future of this API hangs the UI, since the future completes on it.
0 commit comments