Exemple #1
0
 internal _BroadcastStreamController(_stream.ControllerCallback onListen,
                                     _stream.ControllerCancelCallback onCancel)
 {
     this.onListen = onListen;
     this.onCancel = onCancel;
     _state        = _STATE_INITIAL;
 }
Exemple #2
0
 internal _StreamController(_stream.ControllerCallback onListen, _stream.ControllerCallback onPause,
                            _stream.ControllerCallback onResume, _stream.ControllerCancelCallback onCancel)
 {
     this.onListen = onListen;
     this.onPause  = onPause;
     this.onResume = onResume;
     this.onCancel = onCancel;
 }
Exemple #3
0
 public static StreamController <T> create(
     _stream.ControllerCallback onListen       = null,
     _stream.ControllerCallback onPause        = null,
     _stream.ControllerCallback onResume       = null,
     _stream.ControllerCancelCallback onCancel = null,
     //  Action onListen = null,
     //  Action onPause = null,
     //  Action onResume = null,
     // Action onCancel = null,
     bool sync = false)
 {
     return(sync
         ? (StreamController <T>) new _SyncStreamController <T>(onListen, onPause, onResume, onCancel)
         : new _AsyncStreamController <T>(onListen, onPause, onResume, onCancel));
 }