<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          FaustPython 流處理

          聯(lián)合創(chuàng)作 · 2023-09-18 20:23

          Faust 是一個(gè)流處理庫(kù),將想法從 Kafka Streams 移植到 Python。

          它在 Robinhood 用于構(gòu)建高性能的分布式系統(tǒng)和實(shí)時(shí)數(shù)據(jù)管道,每天處理數(shù)十億個(gè)事件。

          Faust 提供流處理和事件處理,與 Kafka Streams,Apache Spark / Storm / Samza / Flink 等工具共享相似性,

          它不使用 DSL,它只是 Python!這意味著您可以在流處理時(shí)使用所有您喜歡的 Python 庫(kù):NumPy,PyTorch,Pandas,NLTK,Django,F(xiàn)lask,SQLAlchemy,++

          Faust 需要 Python 3.6 或更高版本才能使用新的 async / await 語法和變量類型注釋。

          特性:

          • 簡(jiǎn)單易使用
          • 高度可用
          • 快速
          • 靈活性

          以下是處理傳入訂單流的示例:

          # Python Streams ?(???)?
          # Forever scalable event processing & in-memory durable K/V store;
          # w/ asyncio & static typing.
          import faust
          
          app = faust.App('myapp', broker='kafka://localhost')
          
          # Models describe how messages are serialized:
          # {"account_id": "3fae-...", amount": 3}
          class Order(faust.Record):
              account_id: str
              amount: int
          
          @app.agent(value_type=Order)
          async def order(orders):
              async for order in orders:
                  # process infinite stream of orders.
                  print(f'Order for {order.account_id}: {order.amount}')

           

          瀏覽 15
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  啊啊啊操我视频 | 天天操天天射天天日 | 91撸视频 | 黄色视频免费观看 | 欧美三级国产精品 |