[英]How to buffer string stream with Observable?
我有無盡的二進制流,現在我希望每個10000個字符緩沖它們。
theFunctionKeepsStreamingString()
.bufferWithCount(10000) //this is not working
.map((data)=>{
//dealing with each 10000 characters
});
但是,似乎它不能像這樣工作。 我該怎么做呢 ?
我在這里沒有任何問題。
在Plunkr上進行了測試:
const { Observable } = Rx;
const characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
Observable
.from(characters)
.bufferCount(3)
.do(console.log)
.subscribe();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.