|
2 | 2 |
|
3 | 3 | import logging
|
4 | 4 | import pathlib
|
5 |
| -import warnings |
6 | 5 | from typing import TYPE_CHECKING
|
7 | 6 |
|
8 | 7 | import rerun_bindings as bindings
|
9 |
| -from typing_extensions import deprecated # type: ignore[misc, unused-ignore] |
10 | 8 |
|
11 | 9 | from rerun.blueprint.api import BlueprintLike, create_in_memory_blueprint
|
12 | 10 |
|
@@ -213,74 +211,6 @@ def disconnect(recording: RecordingStream | None = None) -> None:
|
213 | 211 | )
|
214 | 212 |
|
215 | 213 |
|
216 |
| -@deprecated( |
217 |
| - """Please migrate to `rr.serve_web(…)`. |
218 |
| - See: https://www.rerun.io/docs/reference/migration/migration-0-20 for more details.""", |
219 |
| -) |
220 |
| -def serve( |
221 |
| - *, |
222 |
| - open_browser: bool = True, |
223 |
| - web_port: int | None = None, |
224 |
| - grpc_port: int | None = None, |
225 |
| - default_blueprint: BlueprintLike | None = None, |
226 |
| - recording: RecordingStream | None = None, |
227 |
| - server_memory_limit: str = "25%", |
228 |
| -) -> None: |
229 |
| - """ |
230 |
| - Serve log-data over WebSockets and serve a Rerun web viewer over HTTP. |
231 |
| -
|
232 |
| - !!! Warning "Deprecated" |
233 |
| - Please migrate to [rerun.serve_web][]. |
234 |
| - See [the migration guide](https://www.rerun.io/docs/reference/migration/migration-0-20) for more details. |
235 |
| -
|
236 |
| - You can also connect to this server with the native viewer using `rerun localhost:9090`. |
237 |
| -
|
238 |
| - The WebSocket server will buffer all log data in memory so that late connecting viewers will get all the data. |
239 |
| - You can limit the amount of data buffered by the WebSocket server with the `server_memory_limit` argument. |
240 |
| - Once reached, the earliest logged data will be dropped. |
241 |
| - Note that this means that static data may be dropped if logged early (see <https://github.com/rerun-io/rerun/issues/5531>). |
242 |
| -
|
243 |
| - This function returns immediately. |
244 |
| -
|
245 |
| - Parameters |
246 |
| - ---------- |
247 |
| - open_browser: |
248 |
| - Open the default browser to the viewer. |
249 |
| - web_port: |
250 |
| - The port to serve the web viewer on (defaults to 9090). |
251 |
| - grpc_port: |
252 |
| - The port to serve the gRPC server on (defaults to 9876) |
253 |
| - default_blueprint: |
254 |
| - Optionally set a default blueprint to use for this application. If the application |
255 |
| - already has an active blueprint, the new blueprint won't become active until the user |
256 |
| - clicks the "reset blueprint" button. If you want to activate the new blueprint |
257 |
| - immediately, instead use the [`rerun.send_blueprint`][] API. |
258 |
| - recording: |
259 |
| - Specifies the [`rerun.RecordingStream`][] to use. |
260 |
| - If left unspecified, defaults to the current active data recording, if there is one. |
261 |
| - See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. |
262 |
| - server_memory_limit: |
263 |
| - Maximum amount of memory to use for buffering log data for clients that connect late. |
264 |
| - This can be a percentage of the total ram (e.g. "50%") or an absolute value (e.g. "4GB"). |
265 |
| -
|
266 |
| - """ |
267 |
| - |
268 |
| - warnings.warn( |
269 |
| - message=("`serve` is deprecated. Use `serve_web` instead."), |
270 |
| - category=DeprecationWarning, |
271 |
| - stacklevel=2, |
272 |
| - ) |
273 |
| - |
274 |
| - return serve_web( |
275 |
| - open_browser=open_browser, |
276 |
| - web_port=web_port, |
277 |
| - grpc_port=grpc_port, |
278 |
| - default_blueprint=default_blueprint, |
279 |
| - recording=recording, # NOLINT |
280 |
| - server_memory_limit=server_memory_limit, |
281 |
| - ) |
282 |
| - |
283 |
| - |
284 | 214 | def serve_web(
|
285 | 215 | *,
|
286 | 216 | open_browser: bool = True,
|
|
0 commit comments