Skip to content
Browse files

Add a convenience method to schedule a stream.

Schedules the stream in the current run loop in the default mode.
  • Loading branch information...
1 parent eb95149 commit 38dc29b952b6fc50957ea9c240ac86dc70c29999 @martinh martinh committed
Showing with 7 additions and 0 deletions.
  1. +2 −0 app/ViBufferedStream.h
  2. +5 −0 app/ViBufferedStream.m
View
2 app/ViBufferedStream.h
@@ -87,6 +87,8 @@
- (void)shutdownWrite;
- (void)shutdownRead;
+- (void)schedule;
+
- (BOOL)getBuffer:(const void **)buf length:(NSUInteger *)len;
- (NSData *)data;
View
5 app/ViBufferedStream.m
@@ -555,6 +555,11 @@ - (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode
CFRunLoopAddSource([aRunLoop getCFRunLoop], _outputSource, (CFStringRef)mode);
}
+- (void)schedule
+{
+ [self scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+}
+
- (void)removeFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode
{
DEBUG(@"removing from mode %@", mode);

0 comments on commit 38dc29b

Please sign in to comment.
Something went wrong with that request. Please try again.