Git Product home page Git Product logo

Comments (5)

pierrec avatar pierrec commented on June 21, 2024

I am not sure what you are experiencing as the example you gave works fine?

from lz4.

pieropio avatar pieropio commented on June 21, 2024

sorry, i gave a wrong version code. see https://go.dev/play/p/vy3P3HZepF_r, which use v4 version.
in code, i write data with length 11 to writer, then I use a buffer with length 12 to read back. But the v4 version can't read the result, it try to fullfill the 12 length buffer.

from lz4.

pierrec avatar pierrec commented on June 21, 2024

Because you need to handle the error, which in this case is io.EOF as expected.

See https://go.dev/play/p/tikjFzpdika

from lz4.

pieropio avatar pieropio commented on June 21, 2024

What if (in line 20) the writer was not close the the pipe? (it is used to write other message later, in my application). In which case, the writer have flush the message, but reader is still stucked.
ps: v3 is works fine, and snappy https://github.com/golang/snappy works fines.

from lz4.

t0350 avatar t0350 commented on June 21, 2024

@pierrec sorry for bother you.
It seems like that the read ends when len(read_buf) == 0, and this may leads to read block. Is this as your expectation or something we misunderstood?
As this example, https://go.dev/play/p/xu9MkdTk0Oy, zw.close is removed now, read will block and exit with all goroutines are asleep.

from lz4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.