Socket
Book a DemoInstallSign in
Socket

em-synchrony-moped

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

em-synchrony-moped

2.0.0.beta.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

EM-Synchrony-Moped

Gem Version Dependency Status Build Status Coverage Status Code Climate

EM-Synchrony-Moped is a Moped driver patch for EM-Synchrony. Moped is the MongoDB driver for the Mongoid ORM.

Features

  • Supports SSL connections and server certificate checking
  • Uses an EventMachine-aware DNS lookup
  • Can be included in threaded applications
  • Unit tested against the threaded (original driver) behavior

Usage

In order to use this driver in an EM-Synchrony environment, simply include the driver.

require "em-synchrony/moped"

EventMachine.synchrony do
  node = Moped::Node.new("localhost:27017")
  puts node.primary?
  EM.stop
end

To use SSL, just pass an SSL config section to the options.

require "em-synchrony/moped"

EventMachine.synchrony do
  options = {
    :ssl => {
        :verify_peer => true,                      # false to skip peer verification
        :verify_cert => "../path-to/ca_cert.pem",  # specify a CA certificate to verify against
                                                   # or...
        :cert_store => OpenSSL::X509::Store.new,   # to specify a cached cert store.
        :verify_host => "localhost"                # Hostname to verify against, if you wish
                                                   # to verify the hostname in the certificate.
      }
  }
  node = Moped::Node.new("localhost:27017", options)
  puts node.primary?
  EM.stop
end

License

The MIT License - Copyright (c) 2013 Adam Lebsack

FAQs

Package last updated on 24 Sep 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.