lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

As the documentation says: "Sets the arguments together as one message into the
buffer. All other messages in this buffer are discarded." So all messages in the
Yes, you can simply invoke buffer:clear() or listener:clear() even if the buffer
or listener is aborted.

Thank you for your patience. It is evident I did miss some key part in the documentation. My mistake, I am sorry.

buffer is garbage collected the remaining messages of this buffer are still
delivered to the listener. This is already pushed to the github repo ;-)

Thank you very much! I downloaded the library again today!! 

  local s = mtstates.singleton("foo", setupFunction)
is nearly the same as:
  local ok, s = pcall(function() return mtstates.state("foo") end)
  if not ok then s = mtstates.newstate("foo", setupFunction) end

BUT: the difference is: the second version will cause race conditions if two
different threads are trying to get the same state "foo" at the same time. So
the main purpose of mtstates.singleton() is to make this an atomic operation

Ok. Now I got it. Thank you very much for your patience. I am sorry it took so much time from my side to grasp the concept.

Andrea Vitali