惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
量子位
月光博客
月光博客
人人都是产品经理
人人都是产品经理
U
Unit 42
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
美团技术团队
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research
D
Docker
B
Blog
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog

博客园 - xalion

Ubuntu 上 安装 sql server 2022 delphi 12.2 配置Linux 开发环境 Embarcadero 发布开源Bloodshed Dev C++ 分支 实战Devexpress FMX Grid 在ubuntu 上使用wine 运行Delphi win32 应用 苹果体 Delphi 10.4 新功能介绍 如何在unidac 中执行一次查询获得多个数据集? 初识ubuntu上的docker PostgreSQL 基本数据类型及常用SQL 函数操作 一步一步从PostgreSQL安装到delphi 访问 DLL Injection with Delphi(转载) 使用FMXlinux 开发linux 桌面应用 推荐一套免费跨平台的delphi 哈希及加密算法库 提高sqlite 的运行性能(转载) 使用unidac 连接FB 3.0 (含嵌入版) 在datasnap 中使用unidac 访问数据(客户端) 在datasnap 中使用unidac 访问数据(服务器端) More x64 assembler fun-facts–new assembler directives(转载) x64 assembler fun-facts(转载)
Delphi 13.1 内置支持 SSE (Server-Sent Events)
xalion · 2026-03-31 · via 博客园 - xalion

Delphi 13.1 里面提供了非常简单的web流式输出.

代码非常简单。

webbroke 里面建立一个新的action。

procedure Twm.wmsseAction(Sender: TObject; Request: TWebRequest;
  Response: TWebResponse; var Handled: Boolean);
var
   rs: TWebResponseStream;
  i, id:integer;
begin

   rs:=TWebResponseStream.BeginEventsStream(response) ;
    id:=1;
  for I := 0 to 50 do

     begin

         rs.WriteEvent('ddd');
         rs.WriteID(id.ToString );
         rs.WriteData('time'+ datetimetostr(now)   );
         rs.EndEvent;
         inc(id);
         sleep(2000);
     end;
end;

看看运行效果

aa

就这么简单。