Skip to main content

Fustor HTTP Receiver - Transport layer for Fusion to receive events from Agents

Project description

fustor-receiver-http

HTTP Receiver for Fustor Fusion - implements the transport layer for receiving events from Agents.

Overview

This package provides an HTTP-based implementation of the Receiver transport abstraction. It creates FastAPI routers that handle session management and event ingestion.

Installation

pip install fustor-receiver-http

Usage

from fustor_receiver_http import HTTPReceiver, SessionInfo

# Create receiver
receiver = HTTPReceiver(
    receiver_id="main-receiver",
    config={"session_timeout_seconds": 30}
)

# Register API keys for pipes
receiver.register_api_key("fk_abc123", "pipe-1")

# Register callbacks
async def on_session_created(session_id, task_id, pipe_id, client_info):
    # Handle session creation
    return SessionInfo(
        session_id=session_id,
        task_id=task_id,
        pipe_id=pipe_id,
        role="leader",
        created_at=time.time(),
        last_heartbeat=time.time()
    )

async def on_event_received(session_id, events, source_type, is_end):
    # Process events
    return True

receiver.register_callbacks(
    on_session_created=on_session_created,
    on_event_received=on_event_received,
)

# Mount routers in FastAPI app
app.include_router(receiver.get_session_router(), prefix="/api/v1/pipe/session")
app.include_router(receiver.get_ingestion_router(), prefix="/api/v1/pipe/ingest")

API Endpoints

Session Router

  • POST / - Create a new session
  • POST /{session_id}/heartbeat - Send heartbeat
  • DELETE /{session_id} - Terminate session

Ingestion Router

  • POST /{session_id}/events - Ingest event batch

Entry Points

This package registers itself as:

  • fustor.receivers:http - Receiver registry

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fustor_receiver_http-0.8.4.post1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fustor_receiver_http-0.8.4.post1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file fustor_receiver_http-0.8.4.post1.tar.gz.

File metadata

File hashes

Hashes for fustor_receiver_http-0.8.4.post1.tar.gz
Algorithm Hash digest
SHA256 4fb0c6c703d734786e0ff1083d3ecbfddbb44aa5b96f1f35d24a83e5abdd50f3
MD5 d61b1436fa0f20249c2bbc43ae5b018e
BLAKE2b-256 2f3caaf2e78485df479bcba91bce7ce829a6504df95437032cfbf07b69259e00

See more details on using hashes here.

File details

Details for the file fustor_receiver_http-0.8.4.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for fustor_receiver_http-0.8.4.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 b37c03183780a8ebc6c3354075d70032af2e34f7e901947c7eff3a71878ef19f
MD5 b58f6f2906f6675e98ccb891b94fd4bd
BLAKE2b-256 5ba0392c079b08aee92bed02e81c8f208f31b8e665655253a9c4373855676783

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page