Skip to content
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

Added FilecachedInputOutputStream #197

Open
wants to merge 2 commits into
base: feature/182-new-storage
Choose a base branch
from

Conversation

brototyp
Copy link
Member

This PR adds a FilecachedInputOutputStreamSpec. This is a Stream that can written to and read from. This will be used, so when data is received from the server, we can pass the data one layer up while having a file everything is written to.

@brototyp brototyp changed the base branch from develop to feature/182-new-storage September 18, 2019 09:03
init(fileCache: URL) {
writableOutputStream = OutputStream(url: fileCache, append: true)
writableOutputStream?.open()
readableInputStream = InputStream(url: fileCache)!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Force unwrapping should be avoided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about adding a swiftlint:next:disable force_unwrapping ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! What do you think about this?

Suggested change
readableInputStream = InputStream(url: fileCache)!
readableInputStream = InputStream(url: fileCache)! // swiftlint:disable:this force_unwrapping

writableOutputStream?.open()
readableInputStream = InputStream(url: fileCache)!
cacheFile = fileCache
super.init(url: fileCache)!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Force unwrapping should be avoided.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here 😊

Suggested change
super.init(url: fileCache)!
super.init(url: fileCache)! // swiftlint:disable:this force_unwrapping

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@brototyp-bot
Copy link

1 Error
🚫 Please include a CHANGELOG entry to credit yourself!
You can find it at /CHANGELOG.md.
3 Warnings
⚠️ Are there any changes that should be explained in the README.md?
⚠️ Cauli/Data structures/Record.swift#L52 - Top-level declarations should specify Access Control Level keywords explicitly.
⚠️ Cauli/Data structures/Record.swift#L54 - Top-level declarations should specify Access Control Level keywords explicitly.

Example CHANGELOG entry

* **feature/improvement/bugfix** Added FilecachedInputOutputStream  
  [#issue_number](https://github.com/cauliframework/cauli/issues/issue_number) by @brototyp  

Trivial PR?

If you think your PR is trivial and neither a CHANGELOG entry nor a README update is necessary, you can add a #trivial to your PR title. The bot will pick that up and will not warn about a missing CHANGELOG or README entry.

Generated by 🚫 Danger

init(fileCache: URL) {
writableOutputStream = OutputStream(url: fileCache, append: true)
writableOutputStream?.open()
readableInputStream = InputStream(url: fileCache)!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about adding a swiftlint:next:disable force_unwrapping ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants