publish: use stream instead of sync read - closes #52