Skip to content

java.time support for Flow #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fvasco opened this issue May 1, 2019 · 6 comments
Closed

java.time support for Flow #1165

fvasco opened this issue May 1, 2019 · 6 comments
Labels

Comments

@fvasco
Copy link
Contributor

fvasco commented May 1, 2019

Consider to overload Flow operators with milliseconds parameters using Duration instead.

@qwwdfsad qwwdfsad added the flow label May 8, 2019
@avently
Copy link

avently commented May 20, 2019

Why you so like java.time? Why not just Longs? Android has problems with this package

@JakeWharton
Copy link
Contributor

Android doesnnot have problems with it. They're only available on certain API levels, similar to most of the APIs that are exposed.

Longs are in general terrible types for representing anything since it carries no semantic information. Nothing prevents you from adding milliseconds to seconds and interpreting it as hours.

@avently
Copy link

avently commented May 20, 2019

They're only available on certain API levels

Equals to

Android has problems with this package

Coroutines should work everywhere without limiting its support to android users.
Longs looks good when they used like:
10 * 1000 for seconds
10 * 60 * 1000 for minutes
10 * 60 * 60 * 1000 for hours, etc.
No problem with a speed and understanding.

@JakeWharton
Copy link
Contributor

All you've done is emphasize my criticisms.

@elizarov
Copy link
Contributor

We're working on adding durations support to Kotlin stdlib and we will support Kotlin duration types in coroutines library when they become available. There is no plan to direcly support Java's durations, but eventually there will be converters.

@elizarov
Copy link
Contributor

elizarov commented May 7, 2020

It was fixed by #1834

@elizarov elizarov closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants