  Long-term periodicity in the rate of flares is observed for two repeating
sources of fast radio bursts (FRBs). In this paper We present a hydrodynamical
modeling of a massive binary consisting of a magnetar and an early-type star.
We model the interaction of the pulsar wind from the magnetar with an intense
stellar wind. It is shown that only during a fraction of the orbital period
radio emission can escape the system. This explains the duty cycle of the two
repeating FRB sources with periodic activity. The width of the transparency
window depends on the eccentricity, stellar wind properties, and the viewing
angle. To describe properties of the known sources it is necessary to assume
large eccentricities $\gtrsim 0.5$. We apply the maser cyclotron mechanism of
the radio emission generation to model spectral properties of the sources. The
produced spectrum is not wide: $\Delta \nu/\nu \sim 0.2$ and the typical
frequency depends on the radius of the shock where the emission is generated.
The shock radius changes along the orbit. This, together with changing
parameters of the medium, allows us to explain the frequency drift during the
phase of visibility. Frequency dependence of the degree of polarization at few
GHz can be a consequence of a small scale turbulence in the shocked stellar
wind. It is much more difficult to explain huge ($\sim 10^5$ [rad/m$^2$]) and
variable value of the rotation measure observed for FRB 121102. We suggest that
this can be explained if the supernova explosion which produced the magnetar
happened near a dense interstellar cloud with $n \sim100$ cm$^{-3}$.
