require "csv"
class PeopleCsvStream
include Enumerable
HEADERS = %w[id full_name email signed_up_at plan].freeze
import type { IncomingMessage, ServerResponse } from "http";
const MIN_BYTES = 1024;
const INCOMPRESSIBLE = /^(image|video|audio)\/|application\/(zip|gzip|x-brotli|pdf|octet-stream)/i;
class Order < ApplicationRecord
belongs_to :customer
scope :for_export, -> {
select(:id, :reference, :total_cents, :currency, :created_at, :customer_id)
.where.not(exported_at: nil)
import csv
from django.http import StreamingHttpResponse, FileResponse
class Echo:
"""Helper for writing to streaming response."""
use std::collections::HashMap;
#[derive(Debug, PartialEq)]
pub enum LogLevel {
Info,
Warn,
class CommentsChannel < ApplicationCable::Channel
def subscribed
post = find_post
if post
stream_for post
else
import { Response } from 'express';
type Client = { id: number; res: Response };
const clients = new Map<string, Set<Client>>();
let nextId = 1;
<?php
namespace App\Exports;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Carbon;
from sqlalchemy import select
from .models import Order, db
def stream_orders(batch_size=1000):
module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :current_user
def connect
self.current_user = find_verified_user
package feed
import "time"
type Event struct {
ID string `json:"id"`
import csv
class _LineBuffer:
def __init__(self):
self._data = ""