question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inversion of control for a streaming upload provider

See original GitHub issue

I need a way to proxy streaming uploads, that is to forward bytes from the client as soon as they are received, without temp files. To do that, I need to have a file-like object given to the provider for reading - as opposed to the provider giving the request server a file-like object for writing.

I am thinking something along the lines of checking for a flag in doPUT, and if the provider prefers, just give it the reference to environ["wsgi.input"] for reading.

Any thoughts? @mar10 @tomviner

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
samuelfeketecommented, Oct 14, 2016

@mar10, I have made another change to use generators, and I have isolated the code that writes to the file object in the small method processData. This can be overridden, for example, to just hand over the stream to the file object, so that the provider can read from it or forward it to a networking library. https://github.com/mar10/wsgidav/pull/51/commits/ebb0e99f1ec4a1d418a8aaf47424db8e490d9fc0

0reactions
mar10commented, Oct 29, 2016

@samuelfekete could add some lines to the docstring of StreamingFile, maybe a small example how to use it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom providers | NestJS - A progressive Node.js framework
Dependency injection is an inversion of control (IoC) technique wherein you delegate instantiation of dependencies to the IoC container (in our case, the...
Read more >
Processing Files With Java 8 Streams - Reflectoring
Inversion of control (IoC) is simply providing a callback (reaction) to an event that might happen in a system. In other words, instead...
Read more >
Dependency injection in Android | Android Developers
Note: Dependency injection is based on the Inversion of Control principle in which generic code controls the execution of specific code.
Read more >
Spring Interview Questions and Answers | DigitalOcean
Spring IoC container manages Spring Bean life cycle and project-specific configurations such as JNDI lookup. Spring MVC framework can be used to ...
Read more >
Inversion of Control Containers and the Dependency Injection ...
Underlying these containers is a common pattern to how they perform the wiring, a concept they refer under the very generic name of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found