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

"UnAttach" Stream after attach #727

Open
haeferer opened this issue Apr 18, 2023 · 0 comments
Open

"UnAttach" Stream after attach #727

haeferer opened this issue Apr 18, 2023 · 0 comments

Comments

@haeferer
Copy link

Hi,

first thanx for this nice peace of software.

Right now i have a strange problem.

I attach to a container to consume "StdIn" and "StdOut".

ct.attach({stream: true, stdout: true, stderr: true}, async (err, streams) => {
      if (err) return res.status(500).send('Error on Attach');
      uStream.ended = false;
      ct.modem.demuxStream(streams, uStream.cs.out, uStream.cs.err);
      setTimeout(() => {
          uStream.ended = true;
          (streams as any).destroy();
          console.log('Log Stream Ended')
      }, 10000);

Everything works fine with the Stream object.

In the code i want to close the stream (aka "deAttach") but the object doest not have a function "end" (according to the type, end should be available) ???

"destroy" as a function seems to work (i have to "workarround" typescript, cause destory is not typed)

So my question is: Is there a correct way to "deattach" a stream ?

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

No branches or pull requests

1 participant