krowinski / php-mysql-replication

Pure PHP Implementation of MySQL replication protocol. This allow you to receive event like insert, update, delete with their data and raw SQL queries.
MIT License
323 stars 98 forks source link

fix: change type from int to float for heartbeat period #70

Closed misaert closed 4 years ago

misaert commented 4 years ago

According to the MySQL documentation, the heartbeat period configuration permits to have a float type:

The heartbeat interval interval is a decimal value having the range 0 to 4294967 seconds and a resolution in milliseconds; the smallest nonzero value is 0.001.
krowinski commented 4 years ago

tx for mr

Yes when I read documentation I seen this as float but I didn't see any real life case when you need this higher seconds

Do you have any case that need this ?

also there is

       if (0 !== Config::getHeartbeatPeriod()) {
            // master_heartbeat_period is in nanoseconds
            $this->execute('SET @master_heartbeat_period = ' . Config::getHeartbeatPeriod() * 1000000000);
        }
misaert commented 4 years ago

In fact, I need to define the heartbeat period to 0.001 to accelerate my feature test. It permits to finish it to 0.20s instead 1.15s.

Are you ok to change it?

krowinski commented 4 years ago

ok

misaert commented 4 years ago

Thanks. And I want to say you have done a great work with this package 👍