Skip to content

Persistent Background Threads not working as expected #129

@no-itsbackpack

Description

@no-itsbackpack

I currently have this cdq setup from the wiki to support a persistent background thread

1. cdq.contexts.push(:root)
2. cdq.contexts.push(:main)
3. cdq.contexts.push(:private, named: :network)
4.
5. cdq.contexts.on(:network) do |network_context|
6.  
7.   cdq.save(network_context, always_wait: true)
8.   cdq.save(:main)
9. end

Line 5 throws the following error

context.rb:261:in `on:': expected Proc with 0 arguments (got 1) (ArgumentError)

which comes from this line https://github.com/infinitered/cdq/blob/master/motion/cdq/context.rb#L261.
Is there anything I am missing or is the example in the wiki outdated.

I basically want to support a persistent background thread with access to the context being used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions