aio-libs / aio-libs/aiozmq

is there a plan to support `async with`

Aberta
#106 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
431
Forks
57
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

I noticed that we should close the zmq stream by function close.is there a plan to use async with like:
```python
async with aiozmq.create_zmq_stream(
zmq.PAIR,
bind=addr) as server:
while True:
server.write(b"Server message to client")
try:
data = await server.read()
except asyncio.CancelledError:
break
print("Async server read: {data}".format(data=data))
asyncio.sleep(1)
```

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start by locating aiozmq.create_zmq_stream and its close() behavior, then inspect the stream lifecycle and existing asyncio integration. Compare that lifecycle with the proposed async with usage and determine the tests needed to show that entering and leaving the context manages the stream correctly.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
networking
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.