Skip to content

Commit fca0cc2

Browse files
await close calls
1 parent a8ddbec commit fca0cc2

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

docs/examples/example.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
" async def get_geometries(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None) -> List[Geometry]:\n",
286286
" raise NotImplementedError\n",
287287
"\n",
288-
" def close(self):\n",
288+
" async def close(self):\n",
289289
" # This is a completely optional function to include. This will be called when the resource is removed from the config or the module\n",
290290
" # is shutting down.\n",
291291
" LOGGER.debug(f\"{self.name} is closed.\")\n",

docs/examples/module_step2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def get_readings(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -
2929
wifi_signal = [x for x in content[2].split(" ") if x != ""]
3030
return {"link": wifi_signal[2], "level": wifi_signal[3], "noise": wifi_signal[4]}
3131

32-
def close(self):
32+
async def close(self):
3333
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
3434
# is shutting down.
3535
LOGGER.debug(f"{self.name} is closed.")

docs/examples/module_step2_optional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def reconfigure(self, config: ComponentConfig, dependencies: Mapping[ResourceNam
5151
multiplier = 1.0
5252
self.multiplier = multiplier
5353

54-
def close(self):
54+
async def close(self):
5555
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
5656
# is shutting down.
5757
LOGGER.debug(f"{self.name} is closed.")

docs/examples/module_step3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def get_readings(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -
3030
wifi_signal = [x for x in content[2].split(" ") if x != ""]
3131
return {"link": wifi_signal[2], "level": wifi_signal[3], "noise": wifi_signal[4]}
3232

33-
def close(self):
33+
async def close(self):
3434
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
3535
# is shutting down.
3636
LOGGER.debug(f"{self.name} is closed.")

docs/examples/my_cool_arm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ async def get_geometries(self, *, extra: Optional[Dict[str, Any]] = None, timeou
106106
async def get_kinematics(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Tuple[KinematicsFileFormat.ValueType, bytes]:
107107
return KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA, self.kinematics
108108

109-
def close(self):
109+
async def close(self):
110110
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
111111
# is shutting down.
112112
LOGGER.debug(f"{self.name} is closed.")

examples/complex_module/src/arm/my_arm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async def get_kinematics(self, extra: Optional[Dict[str, Any]] = None, **kwargs)
109109
file_data = f.read()
110110
return (KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA, file_data)
111111

112-
def close(self):
112+
async def close(self):
113113
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
114114
# is shutting down.
115115
LOGGER.debug(f"{self.name} is closed.")

examples/complex_module/src/gizmo/my_gizmo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async def do_two(self, arg1: bool, **kwargs) -> str:
7373
def reconfigure(self, config: ComponentConfig, dependencies: Mapping[ResourceName, ResourceBase]):
7474
self.my_arg = config.attributes.fields["arg1"].string_value
7575

76-
def close(self):
76+
async def close(self):
7777
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
7878
# is shutting down.
7979
LOGGER.debug(f"{self.name} is closed.")

examples/simple_module/src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def reconfigure(self, config: ComponentConfig, dependencies: Mapping[ResourceNam
5252
multiplier = 1.0
5353
self.multiplier = multiplier
5454

55-
def close(self):
55+
async def close(self):
5656
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
5757
# is shutting down.
5858
LOGGER.debug(f"{self.name} is closed.")

0 commit comments

Comments
 (0)