hardbyte / hardbyte/python-can

Implement a configurable rate limit

オープン
#2,048 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
1.6k
フォーク
697
PR マージ指標
30日以内にマージされた PR はありません

説明

I am using python-can (more specifically canopen) to send out messages to a bunch or nodes.

Issues seem to arise when I send a lot of packets at the same time, my assumption is that the recipients can not keep up with the frame stream, and thus packets are dropped.

My Idea is to implement some sort of rate limiting, for example by passing messages to a queue and having the library send out all queued messages with an interval inbetween.

Something like
```
queue = queue.Queue()

while True:
msg = queue.get() # blocking
transmit(msg)
time.sleep(1 / self.max_messages_per_second)
```

Cheers!

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。