class_docstr: Queue enables polling for received or sent messages.
  
  This class assumes a single consumer of the queue (concurrent calls to
  `get_messages_nowait` and `wait_for_message` is undefined behavior).
  
  This class implements the ASGI `Send` interface.
docstr: Close the queue, rejecting new messages.
  
  Once the queue is closed, existing messages will be returned from
  `get_messages_nowait` and subsequent calls to `wait_for_message` will
  always return immediately.
docstr_tok: ["Close","the","queue",",","rejecting","new","messages",".","Once","the","queue","is","closed",",","existing","messages","will","be","returned","from","`","get_messages_nowait","`","and","subsequent","calls","to","`","wait_for_message","`","will","always","return","immediately","."]
code: def close(self):
      """Close the queue, rejecting new messages.
  
      Once the queue is closed, existing messages will be returned from
      `get_messages_nowait` and subsequent calls to `wait_for_message` will
      always return immediately.
      """
      self._closed = True
      self._new_message_event.set()
  
imports: import asyncio
  import inspect
  import json
  import logging
  import pickle
  import socket
  from dataclasses import dataclass
  from typing import Any, List, Optional, Tuple, Type
  import starlette
  from fastapi.encoders import jsonable_encoder
  from starlette.types import ASGIApp, Message, Receive, Scope, Send
  from uvicorn.config import Config
  from uvicorn.lifespan.on import LifespanOn
  from ray._private.pydantic_compat import IS_PYDANTIC_2
  from ray.actor import ActorHandle
  from ray.serve._private.constants import SERVE_LOGGER_NAME
  from ray.serve._private.utils import serve_encoders
  from ray.serve.exceptions import RayServeException
label_desc: Use image node_id 2 for calling the MessageQueue obj's underlying member method code with example usage: obj.close() without return types