ejtraderTH | python module is useful for creating multiple threads

 by   ejtraderLabs Python Version: 1.0.4 License: MIT

kandi X-RAY | ejtraderTH Summary

kandi X-RAY | ejtraderTH Summary

ejtraderTH is a Python library. ejtraderTH has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

this tiny little python module is useful for creating multiple threads of any function in seconds. a quick launch mode is added, just type ejtraderth.start(func_name, repeat=10) and it will execute the given function given number of times in parallel. a standard way of measuring elapsed time is added as well. see examples below to understand how to use quick launch mode. after using this library for a number of times in various projects i found that if you pass in lots of data say 1000 data in a list, it was creating 1000 threads to do it all once, how ever in the practical world most of the times cpu's are not capable of creating so many threads at once or worse it eats up all resources at once. to prevent this problem now you can pass in max_threads value by default if you don't pass in the value it will automatically be set equal to 4 just for the safety purpose, and passing a 0 value will throw an error while creating a ejtraderth object this way it will only create specified number of threads at once and will wait untill the previously started threads has finished their job. other than that to keep a track on how many threads are been created in real time you can push in a new log method inn you processing function so that whenever a new thread is created you can see it, there ar two methods of tracking
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ejtraderTH has a low active ecosystem.
              It has 2 star(s) with 1 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              ejtraderTH has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of ejtraderTH is 1.0.4

            kandi-Quality Quality

              ejtraderTH has no bugs reported.

            kandi-Security Security

              ejtraderTH has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              ejtraderTH is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              ejtraderTH releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ejtraderTH
            Get all kandi verified functions for this library.

            ejtraderTH Key Features

            No Key Features are available at this moment for ejtraderTH.

            ejtraderTH Examples and Code Snippets

            No Code Snippets are available at this moment for ejtraderTH.

            Community Discussions

            No Community Discussions are available at this moment for ejtraderTH.Refer to stack overflow page for discussions.

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ejtraderTH

            You can download it from GitHub.
            You can use ejtraderTH like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            Apart from calling the start() attribute we can also use decorators to explicitly make our functions for concurrent execution. This will execute the function as soon as you run your python code, in this case we are trying to perform the same task five times in a row concurrently. The final output of all the function can be accessed by ejtraderTH.result['function_name']. Notice if you set your function on repeat it will always receive a parameter which is it's thread number. In this case we are directly passing our arguments in a list via decorator and receiving the result same way as we did in previous example. This is an another cool way to first convert your function in concurrent function and then passing the argument as how many time you want to execute that function all in parallel. Again we can also specify what arguments we want to pass to the function to process it concurrently. if in the @ejtraderTH.set() decorator you won't pass any max_threads argument max_threads=10 will be set. So, by default if any error occurs the threads will keep on running, in case if you want to ignore some errors but if you want to kill all the thread at once you can use ejtraderTH.stop() while handling errors. if you don't use ejtraderTH.stop() function then the threads will keep on running and filling None in place of returned data. if you used the ejtraderTH.stop() it will kill all active threads immediately and will return the data that were processed by your function so far.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/ejtraderLabs/ejtraderTH.git

          • CLI

            gh repo clone ejtraderLabs/ejtraderTH

          • sshUrl

            git@github.com:ejtraderLabs/ejtraderTH.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link