@capacitor/background-runner 1.0.6-dev-20240416T225651.0 → 1.0.6-dev-20240418T183044.0

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.
@@ -11,8 +11,7 @@ public class BackgroundRunner {
11
11
 
12
12
  public init() {
13
13
  do {
14
- config = try self.loadRunnerConfig()
15
- runner.start()
14
+ config = try self.loadRunnerConfig()
16
15
  } catch {
17
16
  print("could not initialize BackgroundRunner: \(error)")
18
17
  }
@@ -15,36 +15,4 @@ public class Runner {
15
15
  func createContext(name: String) throws -> Context {
16
16
  return try Context(vm: machine, contextName: name, runLoop: runLoop)
17
17
  }
18
-
19
- func start() {
20
- thread = Thread { [weak self] in
21
- defer {
22
- Thread.exit()
23
- }
24
-
25
- guard let self = self else { return }
26
- guard let thread = self.thread else { return }
27
-
28
- while !thread.isCancelled {
29
- self.runLoop.run(mode: .default, before: .distantFuture)
30
- }
31
- }
32
-
33
- thread?.qualityOfService = .userInitiated
34
- thread?.start()
35
- }
36
-
37
- func stop() {
38
- guard let thread = self.thread else {
39
- return
40
- }
41
-
42
- thread.cancel()
43
-
44
- while !thread.isFinished {
45
- Thread.sleep(forTimeInterval: 0.05)
46
- }
47
-
48
- self.thread = nil
49
- }
50
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/background-runner",
3
- "version": "1.0.6-dev-20240416T225651.0",
3
+ "version": "1.0.6-dev-20240418T183044.0",
4
4
  "description": "Capacitor Background Runner",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -81,5 +81,5 @@
81
81
  "src": "android"
82
82
  }
83
83
  },
84
- "gitHead": "e1b54f7215adfbfa3f1a173eaf3e077be6d54a02"
84
+ "gitHead": "11124d27dab552da6e4c3f537607419a702c933d"
85
85
  }