asyncactor 0.28.1__tar.gz → 0.28.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. asyncactor-0.28.1/LICENSE → asyncactor-0.28.4/LICENSE.txt +1 -1
  2. {asyncactor-0.28.1 → asyncactor-0.28.4}/PKG-INFO +3 -3
  3. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/abc.py +1 -2
  4. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/actor.py +3 -5
  5. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/backend/__init__.py +1 -1
  6. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/backend/moat_kv.py +1 -3
  7. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/backend/moat_link.py +5 -3
  8. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/backend/mqtt.py +3 -4
  9. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/backend/mqttproto.py +2 -1
  10. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/events.py +10 -8
  11. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/messages.py +8 -6
  12. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/nodelist.py +4 -0
  13. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor.egg-info/PKG-INFO +3 -3
  14. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor.egg-info/SOURCES.txt +1 -1
  15. {asyncactor-0.28.1 → asyncactor-0.28.4}/pyproject.toml +16 -7
  16. {asyncactor-0.28.1 → asyncactor-0.28.4}/tests/test_actor.py +4 -4
  17. {asyncactor-0.28.1 → asyncactor-0.28.4}/tests/test_mosquitto.py +25 -12
  18. {asyncactor-0.28.1 → asyncactor-0.28.4}/tests/test_mqttproto.py +3 -2
  19. {asyncactor-0.28.1 → asyncactor-0.28.4}/.coveragerc +0 -0
  20. {asyncactor-0.28.1 → asyncactor-0.28.4}/.gitignore +0 -0
  21. {asyncactor-0.28.1 → asyncactor-0.28.4}/.pylintrc +0 -0
  22. {asyncactor-0.28.1 → asyncactor-0.28.4}/.readthedocs.yml +0 -0
  23. {asyncactor-0.28.1 → asyncactor-0.28.4}/.style.yapf +0 -0
  24. {asyncactor-0.28.1 → asyncactor-0.28.4}/CHANGELOG.rst +0 -0
  25. {asyncactor-0.28.1 → asyncactor-0.28.4}/Makefile +0 -0
  26. {asyncactor-0.28.1 → asyncactor-0.28.4}/README.rst +0 -0
  27. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/__init__.py +0 -0
  28. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/backend/serf.py +2 -2
  29. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor/exceptions.py +0 -0
  30. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor.egg-info/dependency_links.txt +0 -0
  31. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor.egg-info/requires.txt +0 -0
  32. {asyncactor-0.28.1 → asyncactor-0.28.4}/asyncactor.egg-info/top_level.txt +0 -0
  33. {asyncactor-0.28.1 → asyncactor-0.28.4}/ci/rtd-requirements.txt +0 -0
  34. {asyncactor-0.28.1 → asyncactor-0.28.4}/ci/test-requirements.txt +0 -0
  35. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/Makefile +0 -0
  36. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/make.bat +0 -0
  37. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/source/_static/.git_empty +0 -0
  38. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/source/actor.rst +0 -0
  39. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/source/conf.py +0 -0
  40. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/source/history.rst +0 -0
  41. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/source/index.rst +0 -0
  42. {asyncactor-0.28.1 → asyncactor-0.28.4}/docs/source/rationale.rst +0 -0
  43. {asyncactor-0.28.1 → asyncactor-0.28.4}/mktag +0 -0
  44. {asyncactor-0.28.1 → asyncactor-0.28.4}/setup.cfg +0 -0
  45. {asyncactor-0.28.1 → asyncactor-0.28.4}/tests/__init__.py +0 -0
  46. {asyncactor-0.28.1 → asyncactor-0.28.4}/tests/mock_serf.py +4 -4
  47. {asyncactor-0.28.1 → asyncactor-0.28.4}/tests/test_serf.py +4 -4
  48. {asyncactor-0.28.1 → asyncactor-0.28.4}/tox.ini +0 -0
@@ -1,5 +1,5 @@
1
1
  Copyright (c) 2014 Kushal Pisavadia
2
- Copyright (c) 2018 Matthias Urlichs
2
+ Copyright (c) 2018-2026 Matthias Urlichs
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -1,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: asyncactor
3
- Version: 0.28.1
3
+ Version: 0.28.4
4
4
  Summary: Async decentralized actor
5
5
  Author-email: Matthias Urlichs <matthias@urlichs.de>
6
+ License-Expression: MIT
6
7
  Project-URL: homepage, https://github.com/smurfix/asyncactor
7
8
  Project-URL: repository, https://github.com/smurfix/asyncactor.git
8
9
  Keywords: MQTT,orchestration,service discovery,anyio
@@ -11,11 +12,10 @@ Classifier: Programming Language :: Python :: 3
11
12
  Classifier: Framework :: AsyncIO
12
13
  Classifier: Framework :: Trio
13
14
  Classifier: Framework :: AnyIO
14
- Classifier: License :: OSI Approved
15
15
  Classifier: Development Status :: 4 - Beta
16
16
  Requires-Python: >=3.9
17
17
  Description-Content-Type: text/x-rst
18
- License-File: LICENSE
18
+ License-File: LICENSE.txt
19
19
  Requires-Dist: anyio~=4.2
20
20
  Requires-Dist: moat-lib-codec
21
21
  Requires-Dist: moat-util~=0.53
@@ -4,9 +4,8 @@ Abstract classes for the underlying transport
4
4
 
5
5
  from __future__ import annotations
6
6
 
7
- from abc import ABCMeta, abstractmethod
8
-
9
7
  import anyio
8
+ from abc import ABCMeta, abstractmethod
10
9
 
11
10
  from typing import TYPE_CHECKING, Union
12
11
 
@@ -6,7 +6,6 @@ from __future__ import annotations
6
6
 
7
7
  import anyio
8
8
  import logging
9
- import os
10
9
  import time
11
10
  from random import Random
12
11
 
@@ -22,7 +21,7 @@ from .events import (
22
21
  TagEvent,
23
22
  UntagEvent,
24
23
  )
25
- from .exceptions import ActorCollisionError, ActorTimeoutError
24
+ from .exceptions import ActorCollisionError
26
25
  from .messages import HistoryMessage, InitMessage, Message, PingMessage, SetupMessage
27
26
  from .nodelist import NodeList
28
27
 
@@ -676,9 +675,8 @@ class Actor(CtxObj):
676
675
  """
677
676
  node = history[0]
678
677
  ping = self._recover_pings.get(node, None)
679
- if (
680
- isinstance(ping, anyio.abc.Event)
681
- or isinstance(ping, int)
678
+ if isinstance(ping, anyio.abc.Event) or (
679
+ isinstance(ping, int)
682
680
  and self._nodes > 1
683
681
  and ping < self._valid_pings - self._nodes / 2
684
682
  ):
@@ -7,7 +7,7 @@ from __future__ import annotations
7
7
 
8
8
  def get_transport(name):
9
9
  "import the named transport class"
10
- from importlib import import_module
10
+ from importlib import import_module # noqa:PLC0415
11
11
 
12
12
  if "." not in name:
13
13
  name = "asyncactor.backend." + name
@@ -4,15 +4,13 @@ Listener on top of a MoaT-KV transport
4
4
 
5
5
  from __future__ import annotations
6
6
 
7
- from asyncactor.abc import MonitorStream, Transport
8
-
9
7
  from moat.util import CtxObj
8
+ from asyncactor.abc import MonitorStream, Transport
10
9
 
11
10
  from typing import TYPE_CHECKING
12
11
 
13
12
  if TYPE_CHECKING:
14
13
  from collections.abc import AsyncIterator
15
-
16
14
  from typing import Self
17
15
 
18
16
 
@@ -12,6 +12,7 @@ except ImportError:
12
12
  from mqttproto import QoS
13
13
 
14
14
  from moat.util import CtxObj, NotGiven
15
+
15
16
  try:
16
17
  from moat.lib.path import Path
17
18
  except ImportError:
@@ -20,11 +21,10 @@ except ImportError:
20
21
  from typing import TYPE_CHECKING
21
22
 
22
23
  if TYPE_CHECKING:
23
- from collections.abc import AsyncIterator, Awaitable
24
-
25
24
  from moat.lib.codec import Codec
26
25
  from moat.link.client import Link
27
26
 
27
+ from collections.abc import AsyncIterator, Awaitable
28
28
  from typing import Self
29
29
 
30
30
 
@@ -52,7 +52,9 @@ class MQTTProtoTransport(Transport):
52
52
  """
53
53
  Send a message.
54
54
  """
55
- return self.conn.send(self.topic, payload, qos=QoS.AT_LEAST_ONCE, codec=self.codec, retain=False)
55
+ return self.conn.send(
56
+ self.topic, payload, qos=QoS.AT_LEAST_ONCE, codec=self.codec, retain=False
57
+ )
56
58
 
57
59
  def __repr__(self):
58
60
  return f"<MQTT:{self.topic} @{self.conn!r}>"
@@ -6,13 +6,12 @@ DEPRECATED. Use "mqttproto" instead.
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- from asyncactor.abc import MonitorStream, Transport
10
-
11
9
  import msgpack
12
-
13
- from moat.util import CtxObj, create_queue
14
10
  from moat.mqtt.client import MQTTClient
15
11
  from moat.mqtt.mqtt.constants import QOS_0
12
+ from moat.util import CtxObj, create_queue
13
+
14
+ from asyncactor.abc import MonitorStream, Transport
16
15
 
17
16
 
18
17
  class MQTTTransport(Transport):
@@ -8,11 +8,12 @@ from asyncactor.abc import MonitorStream, Transport
8
8
 
9
9
  try:
10
10
  from moat.lib.mqtt import QoS
11
- except importError:
11
+ except ImportError:
12
12
  from mqttproto import QoS
13
13
 
14
14
  from moat.util import CtxObj
15
15
  from moat.lib.codec import get_codec
16
+
16
17
  try:
17
18
  from moat.lib.path import Path
18
19
  except ImportError:
@@ -8,7 +8,7 @@ from contextlib import suppress
8
8
 
9
9
  from attrs import define
10
10
 
11
- from typing import TYPE_CHECKING
11
+ from typing import TYPE_CHECKING, TypeVar
12
12
 
13
13
  if TYPE_CHECKING:
14
14
  from .messages import Message
@@ -17,18 +17,20 @@ if TYPE_CHECKING:
17
17
  from typing import Any, ClassVar
18
18
 
19
19
  __all__ = [
20
- "NodeEvent",
21
20
  "AuthPingEvent",
22
- "TagEvent",
23
- "UntagEvent",
24
21
  "DetagEvent",
25
- "RawMsgEvent",
26
- "PingEvent",
27
22
  "GoodNodeEvent",
23
+ "NodeEvent",
24
+ "PingEvent",
25
+ "RawMsgEvent",
28
26
  "RecoverEvent",
29
27
  "SetupEvent",
28
+ "TagEvent",
29
+ "UntagEvent",
30
30
  ]
31
31
 
32
+ TNode = TypeVar("TNode")
33
+
32
34
 
33
35
  class NodeEvent:
34
36
  "Generic event"
@@ -187,6 +189,6 @@ class SetupEvent(NodeEvent):
187
189
 
188
190
  def __init__(self, msg):
189
191
  self.__attrs_init__()
190
- for k in "version cycle gap nodes splits n_hosts".split():
192
+ for k in ["version", "cycle", "gap", "nodes", "splits", "n_hosts"]:
191
193
  with suppress(AttributeError):
192
- setattr(self, k, getattr(msg,k))
194
+ setattr(self, k, getattr(msg, k))
@@ -9,7 +9,7 @@ from contextlib import suppress
9
9
 
10
10
  from attrs import asdict, define
11
11
 
12
- from typing import TYPE_CHECKING
12
+ from typing import TYPE_CHECKING, TypeVar
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  from .node import NodeList
@@ -17,11 +17,11 @@ if TYPE_CHECKING:
17
17
  from typing import Any, ClassVar
18
18
 
19
19
  __all__ = [
20
- "Message",
21
- "SetupMessage",
20
+ "HistoryMessage",
22
21
  "InitMessage",
22
+ "Message",
23
23
  "PingMessage",
24
- "HistoryMessage",
24
+ "SetupMessage",
25
25
  ]
26
26
 
27
27
 
@@ -34,6 +34,8 @@ class DataError(TypeError):
34
34
  """
35
35
 
36
36
 
37
+ TNode = TypeVar("TNode")
38
+
37
39
  _types = {}
38
40
 
39
41
 
@@ -118,7 +120,7 @@ class SetupMessage(_NodeMessage):
118
120
  raise ValueError("cycle must be >= 1")
119
121
  if self.gap < (0.001 if self.override else 0.1):
120
122
  raise ValueError("gap must be >= 0.1")
121
- if self.cycle < self.gap * 3:
123
+ if not self.override and self.cycle < self.gap * 3:
122
124
  raise ValueError("cycle must be >= 3*gap")
123
125
 
124
126
  def __repr__(self):
@@ -161,7 +163,7 @@ class HistoryMessage(Message): # [TNode]
161
163
  Your regular actor announcement.
162
164
  """
163
165
 
164
- value:Any = None
166
+ value: Any = None
165
167
  history: NodeList[TNode] = ()
166
168
 
167
169
  _type: ClassVar[str] = "hist"
@@ -4,10 +4,14 @@ Node list
4
4
 
5
5
  from __future__ import annotations
6
6
 
7
+ from typing import TypeName
8
+
7
9
  __all__ = [
8
10
  "NodeList",
9
11
  ]
10
12
 
13
+ TName = TypeName("TName")
14
+
11
15
 
12
16
  class NodeList(list): # [TName]
13
17
  """
@@ -1,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: asyncactor
3
- Version: 0.28.1
3
+ Version: 0.28.4
4
4
  Summary: Async decentralized actor
5
5
  Author-email: Matthias Urlichs <matthias@urlichs.de>
6
+ License-Expression: MIT
6
7
  Project-URL: homepage, https://github.com/smurfix/asyncactor
7
8
  Project-URL: repository, https://github.com/smurfix/asyncactor.git
8
9
  Keywords: MQTT,orchestration,service discovery,anyio
@@ -11,11 +12,10 @@ Classifier: Programming Language :: Python :: 3
11
12
  Classifier: Framework :: AsyncIO
12
13
  Classifier: Framework :: Trio
13
14
  Classifier: Framework :: AnyIO
14
- Classifier: License :: OSI Approved
15
15
  Classifier: Development Status :: 4 - Beta
16
16
  Requires-Python: >=3.9
17
17
  Description-Content-Type: text/x-rst
18
- License-File: LICENSE
18
+ License-File: LICENSE.txt
19
19
  Requires-Dist: anyio~=4.2
20
20
  Requires-Dist: moat-lib-codec
21
21
  Requires-Dist: moat-util~=0.53
@@ -4,7 +4,7 @@
4
4
  .readthedocs.yml
5
5
  .style.yapf
6
6
  CHANGELOG.rst
7
- LICENSE
7
+ LICENSE.txt
8
8
  Makefile
9
9
  README.rst
10
10
  mktag
@@ -9,7 +9,6 @@ classifiers = [
9
9
  "Framework :: AsyncIO",
10
10
  "Framework :: Trio",
11
11
  "Framework :: AnyIO",
12
- "License :: OSI Approved",
13
12
  "Development Status :: 4 - Beta",
14
13
  ]
15
14
  dependencies = [
@@ -23,12 +22,13 @@ requires-python = ">=3.9"
23
22
  name = "asyncactor"
24
23
  description = "Async decentralized actor"
25
24
  readme = "README.rst"
25
+ license = "MIT"
26
+ license-files = ["LICENSE.txt"]
27
+
26
28
  [[project.authors]]
27
29
  name = "Matthias Urlichs"
28
30
  email = "matthias@urlichs.de"
29
31
 
30
- [project.license]
31
- file = "LICENSE.txt"
32
32
 
33
33
  [project.urls]
34
34
  homepage = "https://github.com/smurfix/asyncactor"
@@ -48,7 +48,7 @@ extend-exclude = ["tests", "docs", "asyncactor/backend/serf.py", "asyncactor/bac
48
48
 
49
49
  [tool.ruff.lint]
50
50
  select = ["ALL"]
51
- ignore = ["ANN","PTH","PERF", "D105", "D107","A003","S101","RUF001","RUF002","PLW1514", "D2","D3","D4","T2","FBT","TRY003","EM10","PLR","C","RET50","TD","FIX","N","ERA","BLE001","COM812","ISC001","UP038"]
51
+ ignore = ["ANN","PTH","PERF", "D105", "D107","A003","S101","RUF001","RUF002","PLW1514", "D2","D3","D4","T2","FBT","TRY003","EM10","PLR","C","RET50","TD","FIX","N","ERA","BLE001","COM812","ISC001"]
52
52
  explicit-preview-rules = true
53
53
 
54
54
  [tool.ruff.lint.flake8-comprehensions]
@@ -60,14 +60,23 @@ builtins-ignorelist = ["id","help"]
60
60
  [tool.ruff.lint.isort]
61
61
  no-lines-before = ["future"]
62
62
  required-imports = ["from __future__ import annotations"]
63
- section-order = ["future","standard-library","first-party","third-party","moat","local-folder","upy","typing"]
63
+ section-order = [
64
+ "future",
65
+ "standard-library",
66
+ "first-party",
67
+ "third-party",
68
+ "upy",
69
+ "moat",
70
+ "local-folder",
71
+ "typing",
72
+ ]
64
73
  extra-standard-library = ["pytest", "anyio"]
65
74
  force-to-top = ["moat.util"]
66
75
 
67
76
  [tool.ruff.lint.isort.sections]
68
- "moat" = ["moat"]
77
+ "moat" = ["moat","asyncactor"]
69
78
  "upy" = ["micropython", "machine", "esp"]
70
- "typing" = ["typing"]
79
+ "typing" = ["typing","collections"]
71
80
 
72
81
  [tool.flake8]
73
82
  max-line-length = 99
@@ -1,9 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import logging
4
- import pytest
5
4
  import time
6
5
 
6
+ import pytest
7
+ import trio
8
+
7
9
  from asyncactor.actor import (
8
10
  Actor,
9
11
  GoodNodeEvent,
@@ -14,8 +16,6 @@ from asyncactor.actor import (
14
16
  UntagEvent,
15
17
  )
16
18
 
17
- import trio
18
-
19
19
  from .mock_serf import stdtest
20
20
 
21
21
  logging.basicConfig(level=logging.INFO)
@@ -63,7 +63,7 @@ async def test_10_all(autojump_clock): # pylint: disable=unused-argument
63
63
  break
64
64
  assert tagged <= 1
65
65
  k.logger.debug("N2 %r", k._values)
66
- # # This bit is broken for some reason
66
+ # # This bit is broken for some reason
67
67
  if False:
68
68
  for x in range(1, 6):
69
69
  assert k._values["c_" + str(x)] == x * 31
@@ -2,9 +2,13 @@ from __future__ import annotations
2
2
 
3
3
  import logging
4
4
  import os
5
- import pytest
6
5
  import time
7
6
 
7
+ import pytest
8
+ import trio
9
+ from moat.mqtt.client import open_mqttclient
10
+ from moat.util import srepr
11
+
8
12
  from asyncactor.actor import (
9
13
  Actor,
10
14
  GoodNodeEvent,
@@ -14,10 +18,6 @@ from asyncactor.actor import (
14
18
  )
15
19
  from asyncactor.backend import get_transport
16
20
 
17
- import trio
18
-
19
- from moat.mqtt.client import open_mqttclient
20
-
21
21
  logging.basicConfig(level=logging.INFO)
22
22
 
23
23
  N = 20
@@ -47,9 +47,9 @@ async def read_loop(client, transport):
47
47
  async def test_20_all():
48
48
  """
49
49
  This test starts multiple servers at the same time and checks that all
50
- of them get their turn.
50
+ of them get their turn. Eventually.
51
51
  """
52
- N = 5 # pylint: disable=redefined-outer-name
52
+ N = 6 # pylint: disable=redefined-outer-name
53
53
  tagged = False
54
54
  msgs = {}
55
55
 
@@ -58,7 +58,18 @@ async def test_20_all():
58
58
  async with open_mqttclient(client_id="act_test_%d" % (i,), config=Config) as C:
59
59
  T = get_transport("mqtt")(C, "test_20")
60
60
  C._tg.start_soon(read_loop, C, T)
61
- async with Actor(T, "c_" + str(i), cfg={"nodes": N, "gap": 0.1, "cycle": 1}) as k:
61
+ async with Actor(
62
+ T,
63
+ "c_" + str(i),
64
+ cfg={
65
+ "nodes": N,
66
+ "gap": 0.15,
67
+ "cycle": 0.2,
68
+ "force_in": True,
69
+ "override": True,
70
+ "splits": N,
71
+ },
72
+ ) as k:
62
73
  task_status.started()
63
74
  await k.set_value(i * 31)
64
75
  c = 0
@@ -82,12 +93,12 @@ async def test_20_all():
82
93
  if c > 2:
83
94
  break
84
95
  assert tagged <= 1
85
- k.logger.debug("N2 %r", k._values)
86
- for x in range(1, 6):
96
+ k.logger.error("N2 %r", k._values)
97
+ for x in range(1, N):
87
98
  assert k._values["c_" + str(x)] == x * 31
88
99
 
89
100
  async with trio.open_nursery() as tg:
90
- for i in range(1, 6):
101
+ for i in range(1, N):
91
102
  await tg.start(s1, i)
92
103
 
93
104
 
@@ -109,7 +120,9 @@ async def test_21_some():
109
120
  T = get_transport("mqtt")(C, "test_21")
110
121
  C._tg.start_soon(read_loop, C, T)
111
122
  nonlocal c
112
- async with Actor(T, "c_" + str(i), cfg={"nodes": 3, "gap": 0.1, "cycle": 1}) as k:
123
+ async with Actor(
124
+ T, "c_" + str(i), cfg={"nodes": 3, "gap": 0.09, "cycle": 0.3, "override": True}
125
+ ) as k:
113
126
  task_status.started()
114
127
  await k.set_value(i * 31)
115
128
  async for m in k:
@@ -2,9 +2,11 @@ from __future__ import annotations
2
2
 
3
3
  import logging
4
4
  import os
5
- import pytest
6
5
  import time
7
6
 
7
+ import pytest
8
+ import trio
9
+
8
10
  from asyncactor.actor import (
9
11
  Actor,
10
12
  GoodNodeEvent,
@@ -14,7 +16,6 @@ from asyncactor.actor import (
14
16
  )
15
17
  from asyncactor.backend import get_transport
16
18
 
17
- import trio
18
19
  try:
19
20
  from moat.lib.mqtt.async_client import AsyncMQTTClient
20
21
  except ImportError:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -3,11 +3,11 @@
3
3
  #
4
4
  from __future__ import annotations
5
5
 
6
- from asyncactor.abc import MonitorStream, Transport
7
-
8
6
  import msgpack
9
7
  from asyncserf import Serf
10
8
 
9
+ from asyncactor.abc import MonitorStream, Transport
10
+
11
11
 
12
12
  class SerfTransport(Transport):
13
13
  def __init__(self, conn: Serf, *topic):
File without changes
File without changes
File without changes
File without changes
@@ -5,18 +5,18 @@ try:
5
5
  except ImportError:
6
6
  from async_exit_stack import AsyncExitStack
7
7
  from async_generator import asynccontextmanager
8
- import anyio
8
+
9
9
  import logging
10
10
  import time
11
11
  from unittest import mock
12
12
 
13
- from asyncactor.abc import MonitorStream, Transport
14
-
13
+ import anyio
15
14
  import attr
16
15
  import trio
17
-
18
16
  from moat.util import create_queue
19
17
 
18
+ from asyncactor.abc import MonitorStream, Transport
19
+
20
20
  logger = logging.getLogger(__name__)
21
21
 
22
22
  otm = time.time
@@ -2,9 +2,12 @@ from __future__ import annotations
2
2
 
3
3
  import logging
4
4
  import os
5
- import pytest
6
5
  import time
7
6
 
7
+ import pytest
8
+ import trio
9
+ from asyncserf import serf_client
10
+
8
11
  from asyncactor.actor import (
9
12
  Actor,
10
13
  GoodNodeEvent,
@@ -14,9 +17,6 @@ from asyncactor.actor import (
14
17
  )
15
18
  from asyncactor.backend import get_transport
16
19
 
17
- import trio
18
- from asyncserf import serf_client
19
-
20
20
  logging.basicConfig(level=logging.INFO)
21
21
 
22
22
  N = 20
File without changes