@@ -138,6 +138,28 @@ public final class GRPCServer: Sendable {
138
138
}
139
139
}
140
140
141
+ /// Creates a new server with no resources.
142
+ ///
143
+ /// - Parameters:
144
+ /// - transport: The transport the server should listen on.
145
+ /// - services: Services offered by the server.
146
+ /// - interceptors: A collection of interceptors providing cross-cutting functionality to each
147
+ /// accepted RPC. The order in which interceptors are added reflects the order in which they
148
+ /// are called. The first interceptor added will be the first interceptor to intercept each
149
+ /// request. The last interceptor added will be the final interceptor to intercept each
150
+ /// request before calling the appropriate handler.
151
+ public convenience init (
152
+ transport: any ServerTransport ,
153
+ services: [ any RegistrableRPCService ] ,
154
+ interceptors: [ any ServerInterceptor ] = [ ]
155
+ ) {
156
+ self . init (
157
+ transport: transport,
158
+ services: services,
159
+ interceptors: interceptors. map { . allServices( interceptor: $0) }
160
+ )
161
+ }
162
+
141
163
/// Creates a new server with no resources.
142
164
///
143
165
/// - Parameters:
@@ -161,6 +183,28 @@ public final class GRPCServer: Sendable {
161
183
self . init ( transport: transport, router: router, interceptors: interceptors)
162
184
}
163
185
186
+ /// Creates a new server with no resources.
187
+ ///
188
+ /// - Parameters:
189
+ /// - transport: The transport the server should listen on.
190
+ /// - router: A ``RPCRouter`` used by the server to route accepted streams to method handlers.
191
+ /// - interceptors: A collection of interceptors providing cross-cutting functionality to each
192
+ /// accepted RPC. The order in which interceptors are added reflects the order in which they
193
+ /// are called. The first interceptor added will be the first interceptor to intercept each
194
+ /// request. The last interceptor added will be the final interceptor to intercept each
195
+ /// request before calling the appropriate handler.
196
+ public convenience init (
197
+ transport: any ServerTransport ,
198
+ router: RPCRouter ,
199
+ interceptors: [ any ServerInterceptor ] = [ ]
200
+ ) {
201
+ self . init (
202
+ transport: transport,
203
+ router: router,
204
+ interceptors: interceptors. map { . allServices( interceptor: $0) }
205
+ )
206
+ }
207
+
164
208
/// Creates a new server with no resources.
165
209
///
166
210
/// - Parameters:
0 commit comments