davidmoten / rxjava2-file

Apache License 2.0
13 stars 0 forks source link

DON #3

Open huangjie155 opened 5 years ago

huangjie155 commented 5 years ago

Code such as::

Observable<String> items=FileObservable.tailer()
        .file("E:\\Temp\\datax_authority\\log\\2019-04-10\\bin\\mysql2hive.log").startPosition(0).sampleTimeMs(500)
        .chunkSize(8192).tailText();
      System.out.println( items.cache().toList().toBlocking().single()); 

not error but not result ,what's wrong ? , at not only version 1.x but also 2.x.

davidmoten commented 5 years ago

Because you used toList which waits for the stream to terminate and it doesn't (it's designed to keep tailing!).

huangjie155 commented 5 years ago

Could you give me a example that can print in terminal ?I want to watch it.


发件人: Dave Moten notifications@github.com 发送时间: 2019年5月20日 20:03 收件人: davidmoten/rxjava2-file 抄送: huangjie155; Author 主题: Re: [davidmoten/rxjava2-file] DON (#3)

Because you used toList which waits for the stream to terminate and it doesn't.

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/davidmoten/rxjava2-file/issues/3?email_source=notifications&email_token=ALNIYSVY4Q2ZO5TSEC3ZCPLPWL7XZA5CNFSM4HOCYOKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZ5KJA#issuecomment-494130468, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALNIYSWO3DMDHZFWN6I6GFDPWL7XZANCNFSM4HOCYOKA.