socialwifi / RouterOS-api

Python API to RouterBoard devices produced by MikroTik.
MIT License
255 stars 98 forks source link

Multiple threads - RouterOsApiParsingError #19

Closed andre-luiz-dos-santos closed 4 years ago

andre-luiz-dos-santos commented 9 years ago

Can a single connection be used from multiple threads simultaneously? I'm currently getting a routeros_api.exceptions.RouterOsApiParsingError whenever I try to do this.

Is there any documentation for this library somewhere?

tomwys commented 9 years ago

You can't use single connection for multiple threads. It would be possible to modify library to make it happen, in fact there is already foundation for that. This library is using Mikrotik async API, so making it multi-thread would be quite simple:

We don't need this feature so we probably won't implement it by ourselves.

There is no documentation whatsoever. We have created this library for our personal needs and shared on Github in case anyone would be interested in using it or contributing. Originally we have used Python code from Mikrotik wiki, but this code worked awful, so we have created this library.

If you would like to contribute by writing some documentation or making this library thread safe it would be great.