# Channel

**Interface**

```php
 /**
  * @param mixed $message
  * @return Generator
  *
  * This function is used to send a message to the channel.
  */
 public function sendGen($message): Generator;

 /**
  * @param mixed $message
  * @return void
  *
  * This function is used to send a message to the channel.
  */
 public function send($message): void;

 /**
  * @param callable $callback
  * @return Generator
  *
  * This function is used to receive a message from the channel.
  */
 public function receiveGen(callable $callback): Generator;

 /**
  * @param callable $callback
  * @return void
  *
  * This function is used to receive a message from the channel.
  */
 public function receive(callable $callback): void;

 /**
  * @return bool
  *
  * This function is used to check if the channel is empty.
  */
 public function isEmpty(): bool;

 /**
  * @return void
  *
  * This function is used to close the channel.
  */
 public function close(): void;

 /**
  * @return bool
  *
  * This function is used to check if the channel is closed.
  */
 public function isClosed(): bool;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://venndev.gitbook.io/vapm/coroutinegen/channel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
