Skip to content

Commit

Permalink
await close calls
Browse files Browse the repository at this point in the history
  • Loading branch information
purplenicole730 committed Oct 26, 2023
1 parent a8ddbec commit fca0cc2
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/examples/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
" async def get_geometries(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None) -> List[Geometry]:\n",
" raise NotImplementedError\n",
"\n",
" def close(self):\n",
" async def close(self):\n",
" # This is a completely optional function to include. This will be called when the resource is removed from the config or the module\n",
" # is shutting down.\n",
" LOGGER.debug(f\"{self.name} is closed.\")\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/module_step2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def get_readings(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -
wifi_signal = [x for x in content[2].split(" ") if x != ""]
return {"link": wifi_signal[2], "level": wifi_signal[3], "noise": wifi_signal[4]}

def close(self):
async def close(self):
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
# is shutting down.
LOGGER.debug(f"{self.name} is closed.")
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/module_step2_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def reconfigure(self, config: ComponentConfig, dependencies: Mapping[ResourceNam
multiplier = 1.0
self.multiplier = multiplier

def close(self):
async def close(self):
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
# is shutting down.
LOGGER.debug(f"{self.name} is closed.")
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/module_step3.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def get_readings(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -
wifi_signal = [x for x in content[2].split(" ") if x != ""]
return {"link": wifi_signal[2], "level": wifi_signal[3], "noise": wifi_signal[4]}

def close(self):
async def close(self):
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
# is shutting down.
LOGGER.debug(f"{self.name} is closed.")
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/my_cool_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def get_geometries(self, *, extra: Optional[Dict[str, Any]] = None, timeou
async def get_kinematics(self, extra: Optional[Dict[str, Any]] = None, **kwargs) -> Tuple[KinematicsFileFormat.ValueType, bytes]:
return KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA, self.kinematics

def close(self):
async def close(self):
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
# is shutting down.
LOGGER.debug(f"{self.name} is closed.")
2 changes: 1 addition & 1 deletion examples/complex_module/src/arm/my_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def get_kinematics(self, extra: Optional[Dict[str, Any]] = None, **kwargs)
file_data = f.read()
return (KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA, file_data)

def close(self):
async def close(self):
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
# is shutting down.
LOGGER.debug(f"{self.name} is closed.")
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_module/src/gizmo/my_gizmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def do_two(self, arg1: bool, **kwargs) -> str:
def reconfigure(self, config: ComponentConfig, dependencies: Mapping[ResourceName, ResourceBase]):
self.my_arg = config.attributes.fields["arg1"].string_value

def close(self):
async def close(self):
# This is a completely optional function to include. This will be called when the resource is removed from the config or the module
# is shutting down.
LOGGER.debug(f"{self.name} is closed.")
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_module/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def reconfigure(self, config: ComponentConfig, dependencies: Mapping[ResourceNam
multiplier = 1.0
self.multiplier = multiplier

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

0 comments on commit fca0cc2

Please sign in to comment.