implement basic producer and consumer