Path: blob/trunk/third_party/closure/goog/messaging/messaging.js
2868 views
// Copyright 2010 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314/**15* @fileoverview Functions for manipulating message channels.16*17*/1819goog.provide('goog.messaging');202122/**23* Creates a bidirectional pipe between two message channels.24*25* @param {goog.messaging.MessageChannel} channel1 The first channel.26* @param {goog.messaging.MessageChannel} channel2 The second channel.27*/28goog.messaging.pipe = function(channel1, channel2) {29channel1.registerDefaultService(goog.bind(channel2.send, channel2));30channel2.registerDefaultService(goog.bind(channel1.send, channel1));31};323334