Browse Source

reviewed usage of gRPC.initialize()

Tim Burks 9 years ago
parent
commit
7caef56d1b

+ 0 - 3
Examples/Echo/Swift/Echo/AppDelegate.swift

@@ -31,7 +31,6 @@
  *
  *
  */
  */
 import Cocoa
 import Cocoa
-import gRPC
 
 
 @NSApplicationMain
 @NSApplicationMain
 class AppDelegate: NSObject, NSApplicationDelegate {
 class AppDelegate: NSObject, NSApplicationDelegate {
@@ -41,8 +40,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
   var echoServer: EchoServer!
   var echoServer: EchoServer!
 
 
   func applicationDidFinishLaunching(_ aNotification: Notification) {
   func applicationDidFinishLaunching(_ aNotification: Notification) {
-    gRPC.initialize()
-
     self.echoServer = EchoServer(address:"localhost:8081")
     self.echoServer = EchoServer(address:"localhost:8081")
     echoServer.start()
     echoServer.start()
   }
   }

+ 1 - 0
Examples/Echo/Swift/Echo/EchoServer.swift

@@ -14,6 +14,7 @@ class EchoServer {
   private var address: String
   private var address: String
 
 
   init(address:String) {
   init(address:String) {
+    gRPC.initialize()
     self.address = address
     self.address = address
   }
   }
 
 

+ 1 - 1
Examples/Sessions/Sessions/AppDelegate.swift

@@ -42,7 +42,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
   }
   }
 
 
   func applicationWillTerminate(_ aNotification: Notification) {
   func applicationWillTerminate(_ aNotification: Notification) {
-    // Currently we don't call shutdown() because we can't be sure that
+    // We don't call shutdown() here because we can't be sure that
     // any running server queues will have stopped by the time this is
     // any running server queues will have stopped by the time this is
     // called. If one is still running after we call shutdown(), the
     // called. If one is still running after we call shutdown(), the
     // program will crash.
     // program will crash.

+ 0 - 3
Examples/StickyNotes/StickyNotes/AppDelegate.swift

@@ -31,7 +31,6 @@
  *
  *
  */
  */
 import Cocoa
 import Cocoa
-import gRPC
 
 
 @NSApplicationMain
 @NSApplicationMain
 class AppDelegate: NSObject, NSApplicationDelegate {
 class AppDelegate: NSObject, NSApplicationDelegate {
@@ -41,8 +40,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
   var stickyServer: StickyServer!
   var stickyServer: StickyServer!
 
 
   func applicationDidFinishLaunching(_ aNotification: Notification) {
   func applicationDidFinishLaunching(_ aNotification: Notification) {
-    gRPC.initialize()
-    
     self.stickyServer = StickyServer(address:"localhost:8085")
     self.stickyServer = StickyServer(address:"localhost:8085")
     stickyServer.start()
     stickyServer.start()
   }
   }