https://matrix.org/blog/2020/09/30/welcoming-gitter-to-matrix | Bridged to #gitter:matrix.org
Is it a Gitter problem? Sounds like you want to file an issue at https://github.com/vector-im/element-web/issues if it's a Element problem
I can't see the message as it kicks me err_needreggednick
import patchy
patchy.patch(
"weakref:WeakSet._commit_removals",
"""\
@@ -1,5 +1,10 @@
def _commit_removals(self):
- l = self._pending_removals
+ pop = self._pending_removals.pop
discard = self.data.discard
- while l:
- discard(l.pop())
+ while True:
+ try:
+ item = pop()
+ except IndexError:
+ return
+ else:
+ discard(item)
"""
)
import itertools
import asyncio
import concurrent.futures
import sys
import threading
threads = 200
def test_all_tasks_threading() -> None:
async def foo() -> None:
await asyncio.sleep(0)
async def create_tasks() -> None:
for i in range(1000):
asyncio.create_task(foo())
await asyncio.sleep(0)
results = []
with concurrent.futures.ThreadPoolExecutor(threads) as tpe:
for f in concurrent.futures.as_completed(
tpe.submit(asyncio.run, create_tasks()) for i in range(threads)
):
results.append(f.result())
assert results == [None] * threads
def main():
for i in itertools.count():
test_all_tasks_threading()
print(f"worked {i}")
return 0
if __name__ == "__main__":
sys.exit(main())