Redix LogoDocumentation
API ReferenceLists

LPop

Remove and return the first element from a list

Syntax

Redix.LPop(key, callback)

Parameters

Prop

Type

Returns

Prop

Type

Examples

-- Process from queue (FIFO with RPush)
Redix.LPop('queue:tasks', function(err, task)
    if not err and task then
        print('Processing task:', task.task)
        ProcessTask(task)
    end
end)

-- Pop from stack (LIFO with LPush)
Redix.LPop('stack', function(err, item)
    print('Popped:', item)
end)