浏览代码

mpre fix

/main
siyao 3 年前
当前提交
95f61b0d
共有 3 个文件被更改,包括 11 次插入11 次删除
  1. 6
      com.unity.uiwidgets/Runtime/async/broadcast_stream_controller.cs
  2. 12
      com.unity.uiwidgets/Runtime/async/stream_controller.cs
  3. 4
      com.unity.uiwidgets/Runtime/async/stream_impl.cs

6
com.unity.uiwidgets/Runtime/async/broadcast_stream_controller.cs


get { return new _StreamSinkWrapper<T>(this); }
}
bool isClosed {
public override bool isClosed {
get { return (_state & _STATE_CLOSED) != 0; }
}

* Each receiving stream may be paused individually, and they handle their
* own buffering.
*/
bool isPaused {
public override bool isPaused {
bool hasListener {
public override bool hasListener {
get => !_isEmpty;
}

12
com.unity.uiwidgets/Runtime/async/stream_controller.cs


public virtual StreamSink<T> sink { get; }
public bool isClosed { get; }
public virtual bool isClosed { get; }
public bool isPaused { get; }
public virtual bool isPaused { get; }
public bool hasListener { get; }
public virtual bool hasListener { get; }
// public abstract void add(T evt);
//

}
/** Whether there is an active listener. */
bool hasListener {
public override bool hasListener {
get => (_state & _STATE_SUBSCRIBED) != 0;
}

//
abstract class _SyncStreamControllerDispatch<T>
: _StreamController<T>, SynchronousStreamController<T> {
int _state { get; set; }
internal virtual int _state { get; set; }
public override void _sendData(T data) {
_subscription._add(data);

this._controller = _controller;
}
StreamSubscription<T> _createSubscription(
internal override StreamSubscription<T> _createSubscription(
Action<T> onData, Action<object, string> onError, Action onDone, bool cancelOnError) =>
_controller._subscribe(onData, onError, onDone, cancelOnError);

4
com.unity.uiwidgets/Runtime/async/stream_impl.cs


// -------------------------------------------------------------------
/** Create a subscription object. Called by [subcribe]. */
StreamSubscription<T> _createSubscription(
internal virtual StreamSubscription<T> _createSubscription(
Action<T> onData, Action<object, string> onError, Action onDone, bool cancelOnError) {
return new _BufferingStreamSubscription<T>(
onData, onError, onDone, cancelOnError);

this._pending = _pending;
}
StreamSubscription<T> _createSubscription(
internal override StreamSubscription<T> _createSubscription(
Action<T> onData, Action<object, string> onError, Action onDone, bool cancelOnError) {
if (_isUsed) throw new Exception("Stream has already been listened to.");
_isUsed = true;

正在加载...
取消
保存