sensor-sdk 0.0.10__tar.gz → 0.0.11__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.

Potentially problematic release.


This version of sensor-sdk might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sensor-sdk
3
- Version: 0.0.10
3
+ Version: 0.0.11
4
4
  Summary: Python sdk for Synchroni
5
5
  Home-page: https://github.com/oymotion/SynchroniSDKPython
6
6
  Author: Martin Ye
@@ -4,6 +4,7 @@ import platform
4
4
  from queue import Queue
5
5
  import struct
6
6
  from typing import Deque, List
7
+ from concurrent.futures import ThreadPoolExecutor
7
8
 
8
9
  from sensor import utils
9
10
  from sensor.gforce import DataSubscription, GForce
@@ -56,6 +57,7 @@ class SensorProfileDataCtx:
56
57
  self.sensorDatas.append(SensorData())
57
58
  self.impedanceData: List[float] = list()
58
59
  self.saturationData: List[float] = list()
60
+ self.dataPool = ThreadPoolExecutor(1, "data")
59
61
 
60
62
  def close(self):
61
63
  self._is_running = False
@@ -306,7 +308,7 @@ class SensorProfileDataCtx:
306
308
  break
307
309
  if sensorData != None and callback != None:
308
310
  try:
309
- asyncio.get_event_loop().run_in_executor(None, callback, sensor, sensorData)
311
+ asyncio.get_event_loop().run_in_executor(self.dataPool, callback, sensor, sensorData)
310
312
  except Exception as e:
311
313
  print(e)
312
314
 
@@ -588,7 +590,7 @@ class SensorProfileDataCtx:
588
590
  break
589
591
  if sensorData != None and callback != None:
590
592
  try:
591
- asyncio.get_event_loop().run_in_executor(None, callback, sensor, sensorData)
593
+ asyncio.get_event_loop().run_in_executor(self.dataPool, callback, sensor, sensorData)
592
594
  except Exception as e:
593
595
  print(e)
594
596
 
@@ -609,7 +611,7 @@ class SensorProfileDataCtx:
609
611
  index += 1
610
612
  continue
611
613
  data_package = bytes(self._concatDataBuffer[index + 2 : index + 2 + n])
612
- asyncio.get_event_loop().run_in_executor(None, self.gForce._on_cmd_response, None, data_package)
614
+ asyncio.get_event_loop().run_in_executor(self.dataPool, self.gForce._on_cmd_response, None, data_package)
613
615
  last_cut = index = index + 2 + n
614
616
 
615
617
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sensor-sdk
3
- Version: 0.0.10
3
+ Version: 0.0.11
4
4
  Summary: Python sdk for Synchroni
5
5
  Home-page: https://github.com/oymotion/SynchroniSDKPython
6
6
  Author: Martin Ye
@@ -8,7 +8,7 @@ with open(os.path.join(this_directory, "README.md"), "r", encoding="utf-8") as f
8
8
 
9
9
  setup(
10
10
  name="sensor-sdk",
11
- version="0.0.10",
11
+ version="0.0.11",
12
12
  description="Python sdk for Synchroni",
13
13
  long_description=long_description,
14
14
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes