TorMySQL | The highest performance asynchronous MySQL driver | Reactive Programming library

 by   snower Python Version: 0.4.3 License: MIT

kandi X-RAY | TorMySQL Summary

kandi X-RAY | TorMySQL Summary

TorMySQL is a Python library typically used in Programming Style, Reactive Programming applications. TorMySQL has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install TorMySQL' or download it from GitHub, PyPI.

Presents a Future-based API and greenlet for non-blocking access to MySQL. Support both tornado and asyncio.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              TorMySQL has a low active ecosystem.
              It has 303 star(s) with 61 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 30 have been closed. On average issues are closed in 23 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of TorMySQL is 0.4.3

            kandi-Quality Quality

              TorMySQL has 0 bugs and 0 code smells.

            kandi-Security Security

              TorMySQL has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              TorMySQL code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              TorMySQL 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

              TorMySQL releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              TorMySQL saves you 850 person hours of effort in developing the same functionality from scratch.
              It has 2061 lines of code, 209 functions and 27 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed TorMySQL and discovered the below as its top functions. This is intended to give you an instant insight into TorMySQL implemented functionality, and help decide if they suit your requirements.
            • Connect to the server
            • Return a new cursor object
            • Initialize connection
            • Wrapper for async_call
            • Read num_bytes
            • Close the socket
            • Read from the stream
            • Read number of bytes from the stream
            • Check if all idle connections have expired
            • Close a connection
            • Gets the last query
            • Start an SSLIOStream
            • Called when the connection is closed
            • Close the connection
            • Configure asyncio
            • Use tornado tornado IOLoop
            • Callback called when a connection is connected
            • Continue the next wait
            • Handle events
            • Set the state of the stream
            • Close the stream
            • Write data to the MySQL server
            • Read from the server
            • Create a tornado tornado tornado IOLoop
            • Send data to the server
            • Close the cursor
            Get all kandi verified functions for this library.

            TorMySQL Key Features

            No Key Features are available at this moment for TorMySQL.

            TorMySQL Examples and Code Snippets

            PyMySql query in async function
            Pythondot img1Lines of Code : 28dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            self.pool = tormysql.ConnectionPool(
                    max_connections=256,
                    wait_connection_timeout=5,
                    idle_seconds=7200,
                    host=,
                    db=,
                    user=,
                    passwd=,
                    cursorclass=tormysql.cursor.DictCursor,
               

            Community Discussions

            QUESTION

            Python, Tornado, TorMySQL
            Asked 2018-Nov-24 at 01:46

            I have an old, large project based in Python 2.7 with Tornado framework. To work with MySQL, it initially used Tornado-MySQL with raw SQL queries, and it worked well, but now it must use MySQL 8, and that library is obsolete, unmaintained.

            So, now I set TorMySQL library – it connects well to MySQL Server 8, but I don't fully understand how to use it, and this leads so bugs.

            In one project's file I wrote this code to access databases:

            ...

            ANSWER

            Answered 2018-Nov-24 at 01:46

            You probably have to conn.commit() even after a SELECT query - otherwise a run of SELECT queries are done within the same transaction as the first.

            I think most users are accustomed to "autocommit" by default, but that does not seem to be the default mode for TorMySQL

            (I was confused the same as you were, for the first couple days of using TorMySQL :)

            Source https://stackoverflow.com/questions/53346124

            QUESTION

            Tornado websockets with mysql and redis
            Asked 2018-Apr-27 at 09:32

            I have a tornado server which will create web-socket connection with clients. Whenever a client requests for some data I need to get it from either Redis or MySQL-DB. In addition to this I need to listen to broadcast from the tornado server, receive the network packets and send them to the clients if they are subscribed for the data. This sending of broadcast packets to client depends on the token which will be there in the packet. If clients are subscribed to the token we should send the packet to him.

            Request rate:

            1. 5000 active web socket connections(Which can increase)
            2. 1-DB request per socket-connection per second so total 5000 DB-requests/second
            3. 1-Redis request per socket-connection per second so total 5000 Redis-requests/second.
            4. In broadcast I should listen to 1000 packets/second and check if any of the users are subscribed for the token.

            I know redis is single threaded and work asynchronously(correct me if I am wrong). For MySQL-DB asynchronous driver which I am using is `tormysql`(Most of my calls to DB are select queries and no complex DB operations.).

            My Question:

            1. Will the call to MySQL-DB is blocking? If they are blocking call can I run different thread/process just for DB queries?
            2. Is there a chance that tornado drop packets on the broadcast?
            3. I can have a load-balancer in front of my resources and server them but is it possible that I can use a single CPU with 2-cores 8-GB RAM?

            Update 1:
            I have written a code for MySQL:
            Server.py

            ...

            ANSWER

            Answered 2018-Apr-27 at 08:26
            1. Will the call to MySQL-DB is blocking? If they are blocking call can I run different thread/process just for DB queries?

            As you mentioned you're using tormysql as the driver, so no, the calls won't block since tormysql is asynchronous.

            1. Is there a chance that tornado drop packets on the broadcast?

            I don't quite understand what you mean by that. But since the websocket protocol is built on TCP, so delivery of all the packets is guaranteed. TCP takes care of that.

            1. I can have a load-balancer in front of my resources and server them but is it possible that I can use a single CPU with 2-cores 8-GB RAM?

            Yes.

            I think you're overthinking your application at this point. Premature optimization is evil. You haven't written any code yet and you're thinking about performance. It's just wasting your time.

            Write the code first, then stress test it to see how much load can your application handle. Then do profiling to see where the things are slowing down. Then you optimize the code, or change your setup and maybe upgrade your hardware.

            But just thinking about performance without writing and stress testing the code is just a waste of time.

            Source https://stackoverflow.com/questions/50038530

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

            Vulnerabilities

            No vulnerabilities reported

            Install TorMySQL

            You can install using 'pip install TorMySQL' or download it from GitHub, PyPI.
            You can use TorMySQL 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

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

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

            Find more libraries
            Install
          • PyPI

            pip install tormysql

          • CLONE
          • HTTPS

            https://github.com/snower/TorMySQL.git

          • CLI

            gh repo clone snower/TorMySQL

          • sshUrl

            git@github.com:snower/TorMySQL.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

            Consider Popular Reactive Programming Libraries

            axios

            by axios

            RxJava

            by ReactiveX

            async

            by caolan

            rxjs

            by ReactiveX

            fetch

            by github

            Try Top Libraries by snower

            forsun

            by snowerPython

            forsun-laravel

            by snowerPHP

            slock

            by snowerGo

            torpeewee

            by snowerPython

            TorThrift

            by snowerPython