Giter Site home page Giter Site logo

Comments (5)

kevinherron avatar kevinherron commented on June 5, 2024

This race condition is discussed here: kevinherron/ua-client-sdk#8

To fix it beyond using the MonitoringMode to control when values get published going to require some fundamental changes to the way the client works or to the API for creating items. I have not really decided what to do about it yet...

from milo.

kevinherron avatar kevinherron commented on June 5, 2024

The more I look at this the more I think the only good solution is to change the API. Anything else will result in the API being non-obvious to use.

Something like this:

createMonitoredItems(TimestampsToReturn timestampsToReturn,
                     List<MonitoredItemCreateRequest> itemsToCreate,
                     Consumer<UaMonitoredItem> itemCreationCallback);

Where the callback is your opportunity to set value and event consumers on the item after it is created, with the guarantee by the implementation that it will prevent values from arriving before your consumers are set so long as you do it during the callback.

from milo.

ctron avatar ctron commented on June 5, 2024

Wouldn't it a possibility to pass in the consumer which you later set anyway?

from milo.

kevinherron avatar kevinherron commented on June 5, 2024

You have to allow for them to set a Consumer or BiConsumer of both DataValue and Variant[] (for value and event subscriptions). This would require 4 different overloaded calls and you would not be able to create value and event items in the same call.

from milo.

kevinherron avatar kevinherron commented on June 5, 2024

Please have a look at the proposed fix in PR #13

from milo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.