类 InMemoryTaskStore

java.lang.Object
io.github.a2ap.core.server.impl.InMemoryTaskStore
所有已实现的接口:
TaskStore

public class InMemoryTaskStore extends Object implements TaskStore
In-memory implementation of the TaskStore interface for development and testing purposes. This implementation stores task data and their associated message history in a thread-safe ConcurrentHashMap. It provides fast access to task information but does not persist data beyond the application lifecycle. Key characteristics: - Thread-safe operations using ConcurrentHashMap - No persistence - data is lost when the application stops - Suitable for development, testing, and single-instance deployments - Fast in-memory access with O(1) lookup performance Limitations: - Data is not persisted across application restarts - Memory usage grows with the number of stored tasks - Not suitable for distributed deployments - No built-in cleanup or expiration mechanisms For production deployments requiring persistence, consider implementing TaskStore with a database or distributed cache backend.
  • 构造器详细资料

    • InMemoryTaskStore

      public InMemoryTaskStore()
  • 方法详细资料

    • save

      public void save(Task task)
      从接口复制的说明: TaskStore
      Saves a task and its associated message history. Overwrites existing data if the task ID exists.
      指定者:
      save 在接口中 TaskStore
      参数:
      task - The task context object to save.
    • load

      public Task load(String taskId)
      从接口复制的说明: TaskStore
      Loads a task and its history by task ID.
      指定者:
      load 在接口中 TaskStore
      参数:
      taskId - The ID of the task to load.
      返回:
      an object containing the Task and its history, or null if not found.