Closed chibamap closed 4 years ago
It will take time to review this PR because it is so big.
wow
:+1: (for the feature, haven't read the code yet)
Thanks for your reply. Because my English is no good Maybe some method name or some variable name is fishy. And actually, it need more test for actual business. I continue test and I'll fix if I found any problem.
Great work, I was looking at implementing this myself!!
Getting a WARNING: Tried to load angular more than once.
Be sure to not include angular again since its already in the global namespace.
Thanks for check. I'll research it.
:+1: nice feature!
I think I would do something like this instead of polling every minute. It's not necessarily the best way though. Also, make sure to read all the way to the end.
lib/units/device/plugins/reserve.js
ReserveUpdateMessage
, and send a ReserveUpdateRequestMessage
when the device worker loads (just a sample name)processor
receives it, loads the full schedule for that device from the database, and a ReserveUpdateMessage
back to the device with the detailssetTimeout()
isn't super accurate so it should trigger a bit earlier (and it won't do much harm)setTimeout
, always have a setInterval
running in the background in the device process (perhaps checked once per minute). When the callback triggers, check the internal state if the next reservation is closer than the next internal. If so, kick out current user and make the scheduled user the owner.ReserveUpdateMessage
with the full schedule to the device channel
setTimeout
or setInterval
, run a check immediately, and set up new timersStep 5 could be made easier if we handled messages from the application side in the processor. That way you could just send a tiny message to the processor and it would load and send a full ReserveUpdateMessage
to the device channel. However since it's not possible right now, what you'd probably have to do is to create the full ReserveUpdateMessage
in the websocket
or app
unit, and then send it as-is to the processor.
HOWEVER, I like having the reservation functionality completely separate from the device process like it is in your patch (reaper style). It makes it easier to manage. It would be best if you could adapt the steps in your scheduler
unit instead. You could then even use RethinkDB's .watch()
in the scheduler
unit to load schedule changes in real time, and send ReserveUpdateMessage
to appropriate devices when necessary. That you you wouldn't necessarily have to send a separate message from the websocket
or app
unit to the scheduler
unit, it would automatically see all changes.
Thanks for check. I'll follow them. It's similar to one of my other ideas.
- In there, start listening for a ReserveUpdateMessage, and send a ReserveUpdateRequestMessage when the device worker loads (just a sample name)
- processor receives it, loads the full schedule for that device from the database, and a ReserveUpdateMessage back to the device with the details
You mean, I can "not" access to rethinkdb from device/plugins/reserve.js
right?
my idea is as follow images.
It can make completely separate this feature.
How can I see this feature in installed STF? or Do I need to add this plugin separately?
It's not ready yet. Sorry.
Hi hogehoge-banana, Thanks very much for this nice feature. I added your code and start STF but could not see the screen 'Book Device'. Would you please let me know if I missed something or how we can activate this feature?
Hi, Thanks for check my code. While I'll research it, It will take time. Because Actually I left this project. Now, I just play "stf" on my private time.
Hey @hogehoge-banana ,
This is amazing feature for STF , is this ready yet ? please let me know.
Thanks SK
@skumar1122 Not ready yet. Sorry.
@hogehoge-banana No worries !
@skumar1122 Not ready yet. Sorry.
Since it has been a long time, and have this feature finished?
I’m sorry, but it’s not yet.
Hey @hogehoge-banana @sorccu
I have a question, Can we use stf with admin rights. So that admin can maintain device usage. If its already exists please let me know ?
Thanks Shiva
Hey @hogehoge-banana @sorccu,
Is Device Booking feature is available in Stf version 3.4.1?
I am just start elaborating open-STF. Sorry if you fill my question like new-user
I think, it’s not available. There are big differences from I developed this feature. I’m sorry. Currently I don’t have enough time to spend for this project.
This feature is not merged thus not available in any release.
However, there is a Group feature: https://github.com/openstf/stf/blob/master/doc/GroupFeature.pdf available on latest
tag (not in 3.4.1).
I didn't follow this PR but it looks like these 2 features are partially overlapping.
There are already good feature. So I close this pull request. Thanks all.
Overview
This is Device booking feature. You can book device schedule on device-list. then, device scheduler unit set you to "owner" on the time. And reject other user if the device is busy. device scheduler will check device schedule per a minute.
Note
You can book schedule from one hour later.