JojiiOfficial / Matrix-ClientServer-API-java

A small and simple java API for the Matrix ClientServer Protocol
GNU General Public License v3.0
43 stars 9 forks source link

Use Long Polling #4

Closed RocketJannis closed 4 years ago

RocketJannis commented 4 years ago

This uses long polling method by default. Sync request specifies a timeout of 40 seconds. In this implementation there is no way to change that timeout but I think it has no negative effects.

Reason: Without the timeout it's spamming my homeserver every 200ms. Now it only does new requests when an update arrives or the timeout of 40s runs out.

I already use this for a bot and wanted to make this available to others :)

JojiiOfficial commented 4 years ago

Thank you!