0001 // FallibleReceivingChannel.swift 0002 // 0003 // The MIT License (MIT) 0004 // 0005 // Copyright (c) 2015 Zewo 0006 // 0007 // Permission is hereby granted, free of charge, to any person obtaining a copy 0008 // of this software and associated documentation files (the "Software"), to deal 0009 // in the Software without restriction, including without limitation the rights 0010 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 0011 // copies of the Software, and to permit persons to whom the Software is 0012 // furnished to do so, subject to the following conditions: 0013 // 0014 // The above copyright notice and this permission notice shall be included in all 0015 // copies or substantial portions of the Software. 0016 // 0017 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0018 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0019 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0020 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 0021 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 0022 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 0023 // SOFTWARE. 0024 0025 public final class FallibleReceivingChannel<T
FallibleChannel.swift:28 let channel: FallibleReceivingChannel<T>FallibleChannel.swift:77 public lazy var receivingChannel: FallibleReceivingChannel<T> = FallibleReceivingChannel(self)FallibleChannel.swift:77 public lazy var receivingChannel: FallibleReceivingChannel<T> = FallibleReceivingChannel(self)Select.swift:93 let channel: FallibleReceivingChannel<T>Select.swift:96 init(channel: FallibleReceivingChannel<T>, closure: ChannelResult<T> -> Void) {Select.swift:275 public func receiveFrom<T>(channel: FallibleReceivingChannel<T>?, closure: ChannelResult<T> -> Void) {>: FallibleReceivable, SequenceType { 0026 private let channel
FallibleReceivingChannel.swift:26 private let channel: FallibleChannel<T>FallibleReceivingChannel.swift:28 init(_ channel: FallibleChannel<T>) {FallibleReceivingChannel.swift:32 public func receive() throws -> T? {FallibleReceivingChannel.swift:36 public func receiveResult() -> ChannelResult<T>? {FallibleReceivingChannel.swift:40 public func generate() -> FallibleChannelGenerator<T> {FallibleReceivingChannel.swift:52 func getResultFromBuffer() -> ChannelResult<T>? {: FallibleChannel<T> 0027 0028 init
FallibleReceivingChannel.swift:29 self.channel = channelFallibleReceivingChannel.swift:33 return try channel.receive()FallibleReceivingChannel.swift:37 return channel.receiveResult()FallibleReceivingChannel.swift:45 return channel.close()FallibleReceivingChannel.swift:49 return channel.registerReceive(clause, index: index)FallibleReceivingChannel.swift:53 return channel.getResultFromBuffer()(_ channel: FallibleChannel<T>) { 0029 self.channel = channel 0030 } 0031 0032 public func receive() throws -> T? { 0033 return try channel.receive() 0034 } 0035 0036 public func receiveResult
FallibleChannel.swift:77 public lazy var receivingChannel: FallibleReceivingChannel<T> = FallibleReceivingChannel(self)() -> ChannelResult<T>? { 0037 return channel.receiveResult() 0038 } 0039 0040 public func generate() -> FallibleChannelGenerator<T> { 0041 return FallibleChannelGenerator(channel: self) 0042 } 0043 0044 public func close() -> Bool { 0045 return channel.close() 0046 } 0047 0048 func registerReceive
FallibleChannel.swift:31 return channel.receiveResult()(clause: UnsafeMutablePointer<Void>, index: Int) { 0049 return channel.registerReceive(clause, index: index) 0050 } 0051 0052 func getResultFromBuffer
Select.swift:102 channel.registerReceive(clause, index: index)() -> ChannelResult<T>? { 0053 return channel.getResultFromBuffer() 0054 } 0055 0056 } 0057
Select.swift:106 if let result = channel.getResultFromBuffer() {