Comments (4)
your code here is completely wrong. loop_start starts a new thread. you then do not keep trying to call loop_read/write/misc yourself. the callback is called from the loop thread yes, this is well explained in the mosquitto reference
from lua-mosquitto.
your code here is completely wrong. loop_start starts a new thread. you then do not keep trying to call loop_read/write/misc yourself. the callback is called from the loop thread yes, this is well explained in the mosquitto reference
Ah oops. I misread what :loop_start
was for. Looks like I just call :loop_read
/write/misc as required.
from lua-mosquitto.
So it appears that :loop_start
is always unsafe to use in the style that lua-mosquitto binds it.
Could you remove it from the API?
from lua-mosquitto.
You're perfectly free to implement your own locking and access controls, and there are totally uses where you don't need anything shared, where having it called from other threads is completely ok. I don't see any reason to just go and flat remove the binding, that seems overreaching.
from lua-mosquitto.
Related Issues (15)
- Lua 5.2 support HOT 2
- Create new version tag v0.2 HOT 6
- Add luarocks support HOT 2
- Callbacks occur in same coroutine that mqtt.new is called from HOT 6
- Segmentation fault(core dumped) when using mosquitto client as a thread along with lua lanes HOT 1
- Callbacks need to be longjmp safe HOT 5
- mqtt5 support API design? HOT 1
- SEO; add mqtt to description HOT 4
- reconnect_async missing HOT 1
- create release tag HOT 1
- rockspec for Lua 5.3: LUA_COMPAT_APIINTCASTS HOT 5
- Usage of luaL_checkint HOT 2
- valgrind leak HOT 9
- cpu hog on teardown? pthread_join HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-mosquitto.