浏览代码

fix subscription issue

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

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


public void _recordResume(StreamSubscription<T> subscription) {
}
public Future _recordCancel(StreamSubscription<T> subscription) => null;
public virtual Future _recordCancel(StreamSubscription<T> subscription) => null;
public abstract void _add(T data);

return subscription;
}
Future _recordCancel(StreamSubscription<T> subscription) {
public override Future _recordCancel(StreamSubscription<T> subscription) {
// When we cancel, we first cancel any stream being added,
// Then we call `onCancel`, and finally the _doneFuture is completed.
// If either of addStream's cancel or `onCancel` returns a future,

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


handleData = handleData ?? _stream._nullDataHandler;
// TODO(floitsch): the return type should be 'void', and the type
// should be inferred.
_onData = d => _zone.registerUnaryCallback(data => {
handleData((T) data);
return default;
});
_onData = d => {
_zone.registerUnaryCallback(data =>
{
handleData((T) data);
return default;
}).Invoke(d);
};
}
// Siyao: c# does not support convert action

正在加载...
取消
保存