MCPcopy
hub / github.com/urllib3/urllib3 / _show_streaming_warning

Function _show_streaming_warning

src/urllib3/contrib/emscripten/fetch.py:480–496  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

478
479
480def _show_streaming_warning() -> None:
481 global _SHOWN_STREAMING_WARNING
482 if not _SHOWN_STREAMING_WARNING:
483 _SHOWN_STREAMING_WARNING = True
484 message = "Can't stream HTTP requests because: \n"
485 if not is_cross_origin_isolated():
486 message += " Page is not cross-origin isolated\n"
487 if is_in_browser_main_thread():
488 message += " Python is running in main browser thread\n"
489 if not is_worker_available():
490 message += " Worker or Blob classes are not available in this environment." # Defensive: this is always False in browsers that we test in
491 if streaming_ready() is False:
492 message += """ Streaming fetch worker isn't ready. If you want to be sure that streaming fetch
493is working, you need to call: 'await urllib3.contrib.emscripten.fetch.wait_for_streaming_ready()`"""
494 from js import console
495
496 console.warn(message)
497
498
499def send_request(request: EmscriptenRequest) -> EmscriptenResponse:

Callers 1

send_streaming_requestFunction · 0.85

Calls 4

is_cross_origin_isolatedFunction · 0.85
is_worker_availableFunction · 0.85
streaming_readyFunction · 0.85

Tested by

no test coverage detected