Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query about StreamUpdate grpc #55

Open
Athvaith2828 opened this issue Aug 28, 2024 · 5 comments
Open

Query about StreamUpdate grpc #55

Athvaith2828 opened this issue Aug 28, 2024 · 5 comments

Comments

@Athvaith2828
Copy link

Is StreamUpadate grpc functionality is available in 0.4.6 (latest) release ? and is python-sdk supports StreamUpdate ?

@lukasmittag
Copy link
Contributor

1st part yes. 2nd part not yet but there is a branch for it here https://github.com/boschglobal/kuksa-python-sdk/tree/feature/StreamedSet

@Athvaith2828
Copy link
Author

Thank you for the quick response, @lukasmittag . I'm happy to test the Stream Update functionality—just wanted to check if it's ready for testing from a functionality standpoint ?, Additionally, I have one more question: is sdv/databroker/v1 also supported by the Python SDK?

@lukasmittag
Copy link
Contributor

no the python sdk only supports the kuksa.val.v1 interface. In past versions it supported sdv.databroker.v1.

@Athvaith2828
Copy link
Author

Athvaith2828 commented Aug 28, 2024

@lukasmittag , I am able to access the client.StreamGenerator() function and I understand that it requires a queue to be passed in. Could you provide a simple example of how to use this function to update Vehicle.Speed? That would be very helpful.

@lukasmittag
Copy link
Contributor

I have no example at my hands as of now. But basically you can do the following:

async def __stream_generator() -> AsyncIterator[StreamedUpdateRequest]:
            updates: List[EntryUpdate] = <create an EntryUpdate>
            yield StreamedUpdateRequest(updates=updates)
call = StreamedUpdate(self.__stream_generator())

this will once do update it. If you want to update it more often you need to either do a loop in stream generator or use self.queue and another component that provides speed values to the queue by doing queue.put() and queue.get() for creating an entryUpdate you can have a look at prepare_streamed_set_request() here https://github.com/boschglobal/kuksa-python-sdk/blob/8a0b494b85d01a70f79cb82d77d9c810a0edddf1/kuksa-client/kuksa_client/grpc/__init__.py#L628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants