AS AgentScopeAPI 手册 / API Reference

Queue

public abstract class Queue
源码Source io/agentscope/runtime/common/collections/Queue.java:24–59

队列,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.common.collections 包。核心成员包括 enqueue、dequeue、peek、isEmpty、size。

Abstract base class for queue implementations.

方法摘要Method Summary

方法Method说明Description
public abstract void enqueue(Map<String, Object> item)
abstract
设置该参数。
Adds an item to the queue.
public abstract Map<String, Object> dequeue()
abstract
返回 `dequeue` 结果。
Removes and returns an item from the queue.
public abstract Map<String, Object> peek()
abstract
返回 `peek` 结果。
Returns the front item without removing it.
public abstract boolean isEmpty()
abstract
判断是否 `isEmpty`。
Checks if the queue is empty.
public abstract int size()
abstract
返回数量的条目 in 队列。
Returns the number of items in the queue.

方法详情Method Detail

enqueue

public abstract void enqueue(Map<String, Object> item)
abstract

设置该参数。

Adds an item to the queue.

参数Parameters
名称Name类型Type说明Description
itemMap<String, Object>条目(类型 `Map`)。Item to enqueue (as a Map)
源码Source io/agentscope/runtime/common/collections/Queue.java:30

dequeue

public abstract Map<String, Object> dequeue()
abstract

返回 dequeue 结果。

Removes and returns an item from the queue.

返回Returns Map<String, Object>
返回映射。The dequeued item, or null if queue is empty
源码Source io/agentscope/runtime/common/collections/Queue.java:37

peek

public abstract Map<String, Object> peek()
abstract

返回 peek 结果。

Returns the front item without removing it.

返回Returns Map<String, Object>
返回映射。The front item, or null if queue is empty
源码Source io/agentscope/runtime/common/collections/Queue.java:44

isEmpty

public abstract boolean isEmpty()
abstract

判断是否 isEmpty。

Checks if the queue is empty.

返回Returns boolean
返回布尔值,表示判断结果。true if empty, false otherwise
源码Source io/agentscope/runtime/common/collections/Queue.java:51

size

public abstract int size()
abstract

返回数量的条目 in 队列。

Returns the number of items in the queue.

返回Returns int
返回数值结果。Queue size
源码Source io/agentscope/runtime/common/collections/Queue.java:58
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.