foreground_touch (iai_mcp/concurrency.py)

iai-personal-memory-engine · src/iai_mcp/concurrency.py · python · MIT
infra

Foreground activity beacon for coordinating background work.

# Source: https://github.com/CodeAbra/iai-personal-memory-engine | License: MIT | Copyright 2026 Areg Noya
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

import asyncio
import json
import logging
import os
import threading
import time
from pathlib import Path
from typing import Any, Awaitable, Callable

logger = logging.getLogger(__name__)

SOCKET_PATH: Path = Path.home() / ".iai-mcp" / ".daemon.sock"

# ---------------------------------------------------------------------------
# Foreground-activity beacon
# ---------------------------------------------------------------------------
# A foreground read (a live recall serving a user) and background ingestion
# (the deferred-capture drain, other maintenance loops) contend for the same
# s

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key