This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Features

This package uses mysql-replication to read events from MySQL’s binlog and send to blinker’s signal.

  • binlog action level
  • rows level

It will send RowsEvent only.

Whenever a binlog event come, it will be dispatched into some signals:

  1. binlog_position_signal: 1 signal for the binlog current position
  2. binlog_signal: 1 signal for the binlog event.
  3. rows_signal: 1 signal for event’s rows. 1 signal per row.

Signals

There are 5 signals:

  1. binlog_position_signal: sent whenever binlog event come to notify the current position of binlog stream
  2. binlog_signal: sent whenever binlog event come to notify the binlog event
  3. rows_inserted_signal, rows_updated_signal, rows_deleted_signal: sent on the event as their name

Connect to signals

To connect to a signal, you can use the signal instance or a decorator.

Suppose that you need to connect to write signal on table db0.table1:

from mysqlbinlog2blinker import signals

@signal.rows_updated.connect
def on_rows_updated_signal(table_name, rows, meta):
    pass

@signal.binlog_signal.connect
def on_binlog_signal(event, stream):
    pass

Signal publishing

To start publishing signals

from pymysqlblinker import start_publishing

start_publishing(
    {
        'host': 'localohst',
        'user': 'root',
    },
)

Replication

This package support a method to replicate from mysql database. It operates by keep memory at last binlog position. By default, it save to a file.

To make it, call:

from pymysqlblinker import start_replication

start_replication(
    {
        'host': 'localohst',
        'user': 'root',
    },
    ('/path/to/file/that/remember/binlog/position', 2),
)

Change logs

0.1

  • First version
Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
mysqlbinlog2blinker-0.1.tar.gz (8.8 kB) Copy SHA256 Checksum SHA256 Source Apr 4, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting