- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 15 for stream_items (0.09 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
fastapi/.agents/skills/fastapi/references/streaming.md
# Streaming ## Stream JSON Lines To stream JSON Lines, declare the return type and use `yield` to return the data. ```python @app.get("/items/stream") async def stream_items() -> AsyncIterable[Item]: for item in items: yield item ``` ## Server-Sent Events (SSE) To stream Server-Sent Events, use `response_class=EventSourceResponse` and `yield` items from the endpoint.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 10:05:57 GMT 2026 - 2.5K bytes - Click Count (0) -
docs_src/server_sent_events/tutorial002_py310.py
items = [ Item(name="Plumbus", price=32.99), Item(name="Portal Gun", price=999.99), Item(name="Meeseeks Box", price=49.99), ] @app.get("/items/stream", response_class=EventSourceResponse) async def stream_items() -> AsyncIterable[ServerSentEvent]: yield ServerSentEvent(comment="stream of item updates") for i, item in enumerate(items):Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 09:21:52 GMT 2026 - 686 bytes - Click Count (0) -
docs_src/stream_json_lines/tutorial001_py310.py
Item(name="Portal Gun", description="A portal opening device."), Item(name="Meeseeks Box", description="A box that summons a Meeseeks."), ] @app.get("/items/stream") async def stream_items() -> AsyncIterable[Item]: for item in items: yield item @app.get("/items/stream-no-async") def stream_items_no_async() -> Iterable[Item]: for item in items: yield item
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 18:56:47 GMT 2026 - 936 bytes - Click Count (0) -
internal/store/store.go
if !ok { return } if !send(key) { return } case <-doneCh: return } } } // StreamItems reads the keys from the store and replays the corresponding item to the target. func StreamItems[I any](store Store[I], target Target, doneCh <-chan struct{}, logger logger) { go func() { keyCh := replayItems(store, doneCh, logger, target.Name())Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 4.2K bytes - Click Count (0) -
internal/event/target/nsq.go
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Mar 30 00:56:02 GMT 2025 - 7.1K bytes - Click Count (0) -
internal/event/target/mqtt.go
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri Sep 06 23:06:30 GMT 2024 - 8.2K bytes - Click Count (0) -
internal/event/target/webhook.go
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri Sep 06 23:06:30 GMT 2024 - 8.8K bytes - Click Count (0) -
internal/logger/target/kafka/kafka.go
return fmt.Errorf("unable to initialize the queue store of %s webhook: %w", h.Name(), err) } ctx, cancel := context.WithCancel(ctx) h.store = queueStore h.storeCtxCancel = cancel store.StreamItems(h.store, h, ctx.Done(), h.kconfig.LogOnce) return err } func (h *Target) startKafkaLogger() { h.logChMu.RLock() logCh := h.logCh if logCh != nil { // We are not allowed to add when logCh is nil
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 10.2K bytes - Click Count (0) -
internal/event/target/redis.go
args: args, pool: pool, store: queueStore, loggerOnce: loggerOnce, quitCh: make(chan struct{}), } if target.store != nil { store.StreamItems(target.store, target, target.quitCh, target.loggerOnce) } return target, nil
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Mar 30 00:56:02 GMT 2025 - 9.1K bytes - Click Count (0) -
internal/event/target/kafka.go
Limit: args.BatchSize, Log: loggerOnce, Store: queueStore, CommitTimeout: args.BatchCommitTimeout, }) } store.StreamItems(target.store, target, target.quitCh, target.loggerOnce) } return target, nil } func isKafkaConnErr(err error) bool { // Sarama opens the circuit breaker after 3 consecutive connection failures.
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri Sep 06 23:06:30 GMT 2024 - 13.6K bytes - Click Count (0)