If you want to assign an object to the queue, please make sure it implements JsonSerializable interface. This is how CodeIgniter Entities are handled by default.
You may ask, why not just use serialize and unserialize? There are security reasons that keep us from doing so. These functions are not safe to use with user provided data.
Please see these instructions.