Socket
Book a DemoInstallSign in
Socket

tmm1-em-mysql

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tmm1-em-mysql

0.3.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Async MySQL driver for Ruby/EventMachine (c) 2008 Aman Gupta (tmm1)

Requires mysqlplus and the EM.attach patch.

require 'em/mysql'

alias SQL for simpler syntax

SQL = EventedMysql def SQL(query, &blk) SQL.select(query, &blk) end

setup connection details and allow 4 connections to the server

SQL.settings.update :host => 'localhost', :port => 3306, :database => 'test', :connections => 4

use 4 connections to execute queries in parallel

SQL('select sleep(0.25)'){ p 'done' } SQL('select sleep(0.25)'){ p 'done' } SQL('select sleep(0.25)'){ p 'done' } SQL('select sleep(0.25)'){ p 'done' }

FAQs

Package last updated on 10 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.